diff options
author | Werner Koch <[email protected]> | 2006-04-28 14:31:29 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2006-04-28 14:31:29 +0000 |
commit | 00ffc478de4940b9fbbb9f488f545a65ca7d1278 (patch) | |
tree | 9ec271f1c03397acbd3c6274931ca7a927ae907f /g10/armor.c | |
parent | Still merging 1.4.3 code back (diff) | |
download | gnupg-00ffc478de4940b9fbbb9f488f545a65ca7d1278.tar.gz gnupg-00ffc478de4940b9fbbb9f488f545a65ca7d1278.zip |
Merged recent changes from 1.4
Diffstat (limited to 'g10/armor.c')
-rw-r--r-- | g10/armor.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/g10/armor.c b/g10/armor.c index a154c5cfe..e02591372 100644 --- a/g10/armor.c +++ b/g10/armor.c @@ -1,6 +1,6 @@ /* armor.c - Armor flter - * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, - * 2005 Free Software Foundation, Inc. + * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + * 2006 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -242,12 +242,14 @@ parse_hash_header( const char *line ) found |= 2; else if( !strncmp( s, "MD5", s2-s ) ) found |= 4; - else if( !strncmp( s, "SHA256", s2-s ) ) + else if( !strncmp( s, "SHA224", s2-s ) ) found |= 8; - else if( !strncmp( s, "SHA384", s2-s ) ) + else if( !strncmp( s, "SHA256", s2-s ) ) found |= 16; - else if( !strncmp( s, "SHA512", s2-s ) ) + else if( !strncmp( s, "SHA384", s2-s ) ) found |= 32; + else if( !strncmp( s, "SHA512", s2-s ) ) + found |= 64; else return 0; for(; *s2 && (*s2==' ' || *s2 == '\t'); s2++ ) @@ -676,7 +678,7 @@ radix64_read( armor_filter_context_t *afx, IOBUF a, size_t *retn, int checkcrc=0; int rc = 0; size_t n = 0; - int idx, i; + int idx, i, onlypad=0; u32 crc; crc = afx->crc; @@ -720,6 +722,8 @@ radix64_read( armor_filter_context_t *afx, IOBUF a, size_t *retn, goto again; } } + else if(n==0) + onlypad=1; if( idx == 1 ) buf[n++] = val; @@ -848,7 +852,7 @@ radix64_read( armor_filter_context_t *afx, IOBUF a, size_t *retn, } } - if( !n ) + if( !n && !onlypad ) rc = -1; *retn = n; @@ -951,10 +955,12 @@ armor_filter( void *opaque, int control, if( hashes & 4 ) buf[n++] = DIGEST_ALGO_MD5; if( hashes & 8 ) - buf[n++] = DIGEST_ALGO_SHA256; + buf[n++] = DIGEST_ALGO_SHA224; if( hashes & 16 ) - buf[n++] = DIGEST_ALGO_SHA384; + buf[n++] = DIGEST_ALGO_SHA256; if( hashes & 32 ) + buf[n++] = DIGEST_ALGO_SHA384; + if( hashes & 64 ) buf[n++] = DIGEST_ALGO_SHA512; buf[1] = n - 2; |