tools: Extend gpg-check-pattern.
* tools/gpg-check-pattern.c: Major rewrite.
Here is a simple pattern file:
- Pattern to reject passwords which do not comply to
- - at least 1 uppercase letter
- - at least 1 lowercase letter
- - at least one number
- - at least one special character
- and a few extra things to show the reject mode
Reject is the default mode, ignore case is the default
If the password starts with "foo" (case insensitive) it is rejected.
If the password starts with "bar" (case sensitive) it is rejected.
- Switch to accept mode: Only if all patterns up to the next "accept"
- or "reject" tag or EOF match, the password is accepted. Otherwise
- the password is rejected.
Someone™ please write regression tests.
- Signed-off-by: Werner Koch <email@example.com>