Home GnuPG
Diffusion GnuPG 5ca15e58b241

tools: Extend gpg-check-pattern.

Description

tools: Extend gpg-check-pattern.

* tools/gpg-check-pattern.c: Major rewrite.

Backported-from-master: 73c03e02322880c740310207dd2151cfd843792e

Here is a simple pattern file:

  1. Pattern to reject passwords which do not comply to
  2. - at least 1 uppercase letter
  3. - at least 1 lowercase letter
  4. - at least one number
  5. - at least one special character
  6. and a few extra things to show the reject mode

Reject is the default mode, ignore case is the default

#[reject]
#[icase]

If the password starts with "foo" (case insensitive) it is rejected.

/foo.*/

[case]

If the password starts with "bar" (case sensitive) it is rejected.

/bar.*/

  1. Switch to accept mode: Only if all patterns up to the next "accept"
  2. or "reject" tag or EOF match, the password is accepted. Otherwise
  3. the password is rejected.

[accept]

/[A-Z]+/
/[a-z]+/
/[0-9]+/

/[^A-Za-z0-9]+/

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Jul 29 2021, 11:25 AM
Parents
rG4952ed958413: Post release updates
Branches
Unknown
Tags
Unknown