aboutsummaryrefslogtreecommitdiffstats
path: root/g10/parse-packet.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-10-02 22:01:29 +0000
committerDavid Shaw <[email protected]>2002-10-02 22:01:29 +0000
commit58972f24c406ab1619efac2b3ff91e13923efe5f (patch)
treea7d38634c3621ec7b8412eda3f3641d5be8fbd73 /g10/parse-packet.c
parent* longlong.h: Some whitespace changes in HPPA to fix assembler problems on (diff)
downloadgnupg-58972f24c406ab1619efac2b3ff91e13923efe5f.tar.gz
gnupg-58972f24c406ab1619efac2b3ff91e13923efe5f.zip
* import.c (import_secret_one): Check for an illegal (>110) protection
cipher when importing a secret key. * keylist.c (list_keyblock_print): Show a '#' for a secret-parts-missing key. * parse_packet.c (parse_key): Some comments. * revoke.c (gen_revoke): Remove some debugging code. * trustdb.c (verify_own_keys): Make trusted-key a non-deprecated option again. * seckey-cert.c (do_check): Don't give the IDEA warning unless the cipher in question is in fact IDEA.
Diffstat (limited to 'g10/parse-packet.c')
-rw-r--r--g10/parse-packet.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index a3b39505d..c50c8a2e8 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -1574,6 +1574,9 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
}
sk->protect.sha1chk = (sk->protect.algo == 254);
sk->protect.algo = iobuf_get_noeof(inp); pktlen--;
+ /* Note that a sk->protect.algo > 110 is illegal, but
+ I'm not erroring on it here as otherwise there
+ would be no way to delete such a key. */
sk->protect.s2k.mode = iobuf_get_noeof(inp); pktlen--;
sk->protect.s2k.hash_algo = iobuf_get_noeof(inp); pktlen--;
/* check for the special GNU extension */
@@ -1647,6 +1650,9 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
(ulong)sk->protect.s2k.count);
}
}
+ /* Note that a sk->protect.algo > 110 is illegal, but I'm
+ not erroring on it here as otherwise there would be no
+ way to delete such a key. */
else { /* old version; no S2K, so we set mode to 0, hash MD5 */
sk->protect.s2k.mode = 0;
sk->protect.s2k.hash_algo = DIGEST_ALGO_MD5;