diff options
author | David Shaw <[email protected]> | 2002-11-24 01:49:32 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2002-11-24 01:49:32 +0000 |
commit | a5b9770a8bb139f531b169fa0df47b3286edbb51 (patch) | |
tree | 6bdd32a53c365f527842a849e55543c35638cf20 /g10/g10.c | |
parent | * encode.c (encode_simple), passphrase.c (passphrase_to_dek), sign.c (diff) | |
download | gnupg-a5b9770a8bb139f531b169fa0df47b3286edbb51.tar.gz gnupg-a5b9770a8bb139f531b169fa0df47b3286edbb51.zip |
* g10.c (add_notation_data): Disallow notation names that do not contain a
'@', unless --expert is set. This is to help prevent people from
polluting the (as yet unused) IETF namespace.
* main.h: Comments about default algorithms.
* photoid.c (image_type_to_string): Comments about 3-letter file
extensions.
Diffstat (limited to '')
-rw-r--r-- | g10/g10.c | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -2812,6 +2812,7 @@ add_notation_data( const char *string, int which ) STRLIST sl,*notation_data; int critical=0; int highbit=0; + int saw_at=0; if(which) notation_data=&opt.cert_notation_data; @@ -2823,13 +2824,29 @@ add_notation_data( const char *string, int which ) string++; } - for( s=string ; *s != '='; s++ ) { - if( !*s || (*s & 0x80) || (!isgraph(*s) && !isspace(*s)) ) { + /* If and when the IETF assigns some official name tags, we'll + have to add them here. */ + + for( s=string ; *s != '='; s++ ) + { + if( *s=='@') + saw_at=0; + + if( !*s || (*s & 0x80) || (!isgraph(*s) && !isspace(*s)) ) + { log_error(_("a notation name must have only printable characters " "or spaces, and end with an '='\n") ); return; - } - } + } + } + + if(!saw_at && !opt.expert) + { + log_error( + _("a user notation name must contain the '@' character\n")); + return; + } + /* we only support printable text - therefore we enforce the use * of only printable characters (an empty value is valid) */ for( s++; *s ; s++ ) { |