See ChangeLog: Thu May 20 14:04:08 CEST 1999 Werner Koch

This commit is contained in:
Werner Koch 1999-05-20 12:11:41 +00:00
parent bfb32130e5
commit 77d6309e21
14 changed files with 74 additions and 29 deletions

4
NEWS
View File

@ -1,7 +1,7 @@
* New option --interactive to prompt before overwriting files.
* New option --interactive to prompt before creating files.
* Add a work around for a bug in pgp 2 which led to bad signatures
* Add some work arounds for a bugs in pgp 2 which led to bad signatures
when used with canoncial texts in some cases.

View File

@ -64,7 +64,7 @@ more arguments in future versions.
status lines ere emitted for a good signature.
SIG_ID <radix64_string> <sig_creation_date>
This is emitted only for signatures which
This is emitted only for signatures of class 0 or 1 which
have been verified okay. The string is a signature id
and may be used in applications to detect replay attacks
of signed messages. Note that only DLP algorithms give

15
doc/FAQ
View File

@ -21,7 +21,7 @@
public key, and he would only be able to decrypt it by having the secret
key and putting in the password to use his secret key.
GNUPG is also useful for signing things. Things that are encrypted with
GnuPG is also useful for signing things. Things that are encrypted with
the secret key can be decrypted with the public key. To sign something, a
hash is taken of the data, and then the hash is in some form encoded with
the secret key. If someone has your public key, they can verify that it
@ -71,7 +71,7 @@
readable, just add the '-a' option. But the preferred method is to use
a MIME aware mail reader (Mutt, Pine and many more).
There is a small security glitch in the OpenPGP (and therefor GNUPG) system;
There is a small security glitch in the OpenPGP (and therefore GnuPG) system;
to avoid this you should always sign and encrypt a message instead of only
encrypting it.
@ -85,13 +85,13 @@
"gpg --fingerprint --fingerprint <user ID>".
Q: Why are some signatures with an ELG-E key valid?
A: These are ElGamal Key generated by GNUPG in v3 (rfc1991)
A: These are ElGamal Key generated by GnuPG in v3 (rfc1991)
packets. The OpenPGP draft later changed the algorithm
identifier for ElGamal keys which are usable for signatures
and encryption from 16 to 20. GNUPG now uses 20 when it
and encryption from 16 to 20. GnuPG now uses 20 when it
generates new ElGamal keys but still accept 16 (which is
according to OpenPGP "encryption only") if this key is in
a v3 packet. GNUPG is the only program which had used
a v3 packet. GnuPG is the only program which had used
these v3 ElGamal keys - so this assumption is quite safe.
Q: Why is PGP 5.x not able to encrypt messages with some keys?
@ -120,11 +120,14 @@
Q: How can I encrypt a message so that pgp 2.x is able to decrypt it?
A: You can't do that because pgp 2.x normally uses IDEA which is not
supported by GNUPG because it is patented, but if you have a modified
supported by GnuPG because it is patented, but if you have a modified
version of PGP you can try this:
gpg --rfc1991 --cipher-algo 3des ...
Please don't pipe the data to encrypt to gpg but give it as a filename;
other wise, pgp 2 will not be able to handle it.
Q: How can I conventional encrypt a message, so that PGP can decrypt it?
A: You can't do this for PGP 2. For PGP 5 you should use this:

View File

@ -1,3 +1,16 @@
Thu May 20 14:04:08 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* misc.c (pull_in_libs): do the volatile only for gcc
* sig-check (signature_check): Emit SIG_iD only for classes 0 and 1.
* armor.c (armor_filter): Add detection of PGP2 created clearsigs.
(fake_packet): A tab is not a WS for pgp2 - handle this.
* textfilter.c (len_without_trailing_chars): New.
(copy_clearsig_text): Add pgp2mode arg.
* sign.c (clearsign_file): pass old_style to the above fnc.
Wed May 19 16:04:30 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* g10.c: New option --interactive.

View File

@ -425,9 +425,8 @@ check_input( armor_filter_context_t *afx, IOBUF a )
if( rc )
invalid_armor();
else if( afx->in_cleartext ) {
else if( afx->in_cleartext )
afx->faked = 1;
}
else {
afx->inp_checked = 1;
afx->crc = CRCINIT;
@ -480,7 +479,10 @@ fake_packet( armor_filter_context_t *afx, IOBUF a,
if( !maxlen )
afx->truncated++;
if( !afx->not_dash_escaped ) {
afx->buffer_len = trim_trailing_ws( afx->buffer, afx->buffer_len );
/* PGP2 does not treat a tab as white space character */
afx->buffer_len =
trim_trailing_chars( afx->buffer, afx->buffer_len,
afx->pgp2mode ? " \r\n" : " \t\r\n");
/* the buffer is always allocated with enough space to append
* a CR, LF, Nul */
afx->buffer[afx->buffer_len++] = '\r';
@ -809,8 +811,10 @@ armor_filter( void *opaque, int control,
* is easy to construct the packets */
hashes &= 1|2|4|8;
if( !hashes )
if( !hashes ) {
hashes |= 4; /* default to MD 5 */
afx->pgp2mode = 1;
}
n=0;
do {
/* first some onepass signature packets */

View File

@ -44,6 +44,7 @@ typedef struct {
int faked; /* we are faking a literal data packet */
int truncated; /* number of truncated lines */
int qp_detected;
int pgp2mode;
byte *buffer; /* malloced buffer */
unsigned buffer_size; /* and size of this buffer */
@ -119,7 +120,7 @@ int cipher_filter( void *opaque, int control,
int text_filter( void *opaque, int control,
IOBUF chain, byte *buf, size_t *ret_len);
int copy_clearsig_text( IOBUF out, IOBUF inp, MD_HANDLE md,
int escape_dash, int escape_from );
int escape_dash, int escape_from, int pgp2mode );

View File

@ -41,7 +41,10 @@ const char *g10m_revision_string(int);
const char *g10c_revision_string(int);
const char *g10u_revision_string(int);
volatile void
#ifdef __GNUC__
volatile
#endif
void
pull_in_libs(void)
{
g10m_revision_string(0);

View File

@ -64,7 +64,7 @@ signature_check( PKT_signature *sig, MD_HANDLE digest )
free_public_key( pk );
if( !rc && is_status_enabled() ) {
if( !rc && sig->sig_class < 2 && is_status_enabled() ) {
/* This signature id works best with DLP algorithms because
* they use a random parameter for every signature. Instead of
* this sig-id we could have also used the hash of the document

View File

@ -548,7 +548,7 @@ clearsign_file( const char *fname, STRLIST locusr, const char *outfile )
}
/*md_start_debug( textmd, "sign" );*/
copy_clearsig_text( out, inp, textmd,
!opt.not_dash_escaped, opt.escape_from );
!opt.not_dash_escaped, opt.escape_from, old_style );
/* fixme: check for read errors */
/* now write the armor */

View File

@ -37,14 +37,14 @@
/* to make sure that a warning is displayed while */
/* creating a message */
unsigned
len_without_trailing_ws( byte *line, unsigned len )
static unsigned
len_without_trailing_chars( byte *line, unsigned len, const char *trimchars )
{
byte *p, *mark;
unsigned n;
for(mark=NULL, p=line, n=0; n < len; n++, p++ ) {
if( strchr(" \t\r\n", *p ) ) {
if( strchr( trimchars, *p ) ) {
if( !mark )
mark = p;
}
@ -55,6 +55,12 @@ len_without_trailing_ws( byte *line, unsigned len )
return mark? (mark - line) : len;
}
unsigned
len_without_trailing_ws( byte *line, unsigned len )
{
return len_without_trailing_chars( line, len, " \t\r\n" );
}
@ -136,7 +142,7 @@ text_filter( void *opaque, int control,
*/
int
copy_clearsig_text( IOBUF out, IOBUF inp, MD_HANDLE md,
int escape_dash, int escape_from )
int escape_dash, int escape_from, int pgp2mode )
{
unsigned maxlen;
byte *buffer = NULL; /* malloced buffer */
@ -163,7 +169,9 @@ copy_clearsig_text( IOBUF out, IOBUF inp, MD_HANDLE md,
md_putc( md, '\r' );
md_putc( md, '\n' );
}
md_write( md, buffer, len_without_trailing_ws( buffer, n ) );
md_write( md, buffer,
len_without_trailing_chars( buffer, n,
pgp2mode? " \r\n":" \t\r\n"));
}
else
md_write( md, buffer, n );

View File

@ -163,6 +163,7 @@ STRLIST strlist_last( STRLIST node );
const char *memistr( const char *buf, size_t buflen, const char *sub );
char *mem2str( char *, const void *, size_t);
char *trim_spaces( char *string );
unsigned trim_trailing_chars( byte *line, unsigned len, const char *trimchars);
unsigned trim_trailing_ws( byte *line, unsigned len );
int string_count_chr( const char *string, int c );
int set_native_charset( const char *newset );

View File

@ -1,3 +1,9 @@
Thu May 20 14:04:08 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* memory.c (membug): Nanu, there was a const instead of a static.
* strgutil.c (trim_trailing_chars): New.
Mon May 17 21:54:43 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* logger.c (g10_log_hexdump): Made 2nd arg a const.

View File

@ -48,7 +48,7 @@
#define EXTRA_ALIGN 0
#endif
const void membug( const char *fmt, ... );
static void membug( const char *fmt, ... );
#ifdef M_DEBUG
#ifndef M_GUARD
@ -320,7 +320,7 @@ check_allmem( const char *info )
#endif /* M_DEBUG */
const void
static void
membug( const char *fmt, ... )
{
va_list arg_ptr ;

View File

@ -213,17 +213,14 @@ trim_spaces( char *str )
/****************
* remove trailing white spaces and return the length of the buffer
*/
unsigned
trim_trailing_ws( byte *line, unsigned len )
trim_trailing_chars( byte *line, unsigned len, const char *trimchars )
{
byte *p, *mark;
unsigned n;
for(mark=NULL, p=line, n=0; n < len; n++, p++ ) {
if( strchr(" \t\r\n", *p ) ) {
if( strchr(trimchars, *p ) ) {
if( !mark )
mark = p;
}
@ -238,6 +235,15 @@ trim_trailing_ws( byte *line, unsigned len )
return len;
}
/****************
* remove trailing white spaces and return the length of the buffer
*/
unsigned
trim_trailing_ws( byte *line, unsigned len )
{
return trim_trailing_chars( line, len, " \t\r\n" );
}
int