aboutsummaryrefslogtreecommitdiffstats
path: root/g10/armor.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-11-13 11:01:42 +0000
committerWerner Koch <[email protected]>2014-11-13 11:01:42 +0000
commite30cb8f61792e3808f7c8f343fc8545e6c81fe74 (patch)
tree5d9b73db973dbb96556f11881646c3176b7cc6b1 /g10/armor.c
parentgpg: Improve perceived speed of secret key listings. (diff)
downloadgnupg-e30cb8f61792e3808f7c8f343fc8545e6c81fe74.tar.gz
gnupg-e30cb8f61792e3808f7c8f343fc8545e6c81fe74.zip
gpg: Remove PGP-2 related cruft.
* g10/armor.c (parse_hash_header,carmor_filter): Ignore MD5 in hash header. (fake_packet): Remove pgp-2 workaround for white space stripping. * g10/filter.h (armor_filter_context_t): Remove field pgp2mode. * g10/options.h (opt): Remove field pgp2_workarounds. * g10/gpg.c (main): Do not set this field. * g10/gpgv.c (main): Ditto. * g10/mainproc.c (proc_encrypted): Use SHA-1 as fallback s2k hash algo. Using MD5 here is useless. (proc_plaintext): Remove PGP-2 related woraround (proc_tree): Remove another workaround but keep the one for PGP-5. -- The removed code was either not anymore used or its use would have caused an error message later anyway. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/armor.c')
-rw-r--r--g10/armor.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/g10/armor.c b/g10/armor.c
index efdc92ebc..b00f9854f 100644
--- a/g10/armor.c
+++ b/g10/armor.c
@@ -286,8 +286,6 @@ parse_hash_header( const char *line )
found |= 1;
else if( !strncmp( s, "SHA1", s2-s ) )
found |= 2;
- else if( !strncmp( s, "MD5", s2-s ) )
- found |= 4;
else if( !strncmp( s, "SHA224", s2-s ) )
found |= 8;
else if( !strncmp( s, "SHA256", s2-s ) )
@@ -664,10 +662,9 @@ fake_packet( armor_filter_context_t *afx, IOBUF a,
{
int crlf = n > 1 && p[n-2] == '\r' && p[n-1]=='\n';
- /* PGP2 does not treat a tab as white space character */
afx->buffer_len=
trim_trailing_chars( &p[afx->buffer_pos], n-afx->buffer_pos,
- afx->pgp2mode ? " \r\n" : " \t\r\n");
+ " \t\r\n");
afx->buffer_len+=afx->buffer_pos;
/* the buffer is always allocated with enough space to append
* the removed [CR], LF and a Nul
@@ -1009,14 +1006,9 @@ armor_filter( void *opaque, int control,
/* the buffer is at least 15+n*15 bytes long, so it
* is easy to construct the packets */
- hashes &= 1|2|4|8|16|32|64;
+ hashes &= 1|2|8|16|32|64;
if( !hashes ) {
- hashes |= 4; /* default to MD 5 */
- /* This is non-ideal since PGP 5-8 have the same
- end-of-line bugs as PGP 2. However, we only
- enable pgp2mode if there is no Hash: header. */
- if( opt.pgp2_workarounds )
- afx->pgp2mode = 1;
+ hashes |= 2; /* Default to SHA-1. */
}
n=0;
/* First a gpg control packet... */
@@ -1029,8 +1021,6 @@ armor_filter( void *opaque, int control,
buf[n++] = DIGEST_ALGO_RMD160;
if( hashes & 2 )
buf[n++] = DIGEST_ALGO_SHA1;
- if( hashes & 4 )
- buf[n++] = DIGEST_ALGO_MD5;
if( hashes & 8 )
buf[n++] = DIGEST_ALGO_SHA224;
if( hashes & 16 )