aboutsummaryrefslogtreecommitdiffstats
path: root/g10/parse-packet.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2008-04-18 09:20:25 +0000
committerWerner Koch <[email protected]>2008-04-18 09:20:25 +0000
commit4896f5f47c1a58a4ee81c1ce1ef879fd3156bbe7 (patch)
treefb2741341342ef10c52ef1f345eef45eda8defe0 /g10/parse-packet.c
parentTest commit (diff)
downloadgnupg-4896f5f47c1a58a4ee81c1ce1ef879fd3156bbe7.tar.gz
gnupg-4896f5f47c1a58a4ee81c1ce1ef879fd3156bbe7.zip
Adjust for the changed Camellia draft.
W32 gettext changes. Comment and typo fixes.
Diffstat (limited to 'g10/parse-packet.c')
-rw-r--r--g10/parse-packet.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 409daab09..dbaa27886 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -1901,19 +1901,13 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
* of the IV here in cases we are not aware of the algorithm.
* so a
* sk->protect.ivlen = cipher_get_blocksize(sk->protect.algo);
- * won't work. The only solution I see is to hardwire it here.
+ * won't work. The only solution I see is to hardwire it.
* NOTE: if you change the ivlen above 16, don't forget to
* enlarge temp.
*/
- switch( sk->protect.algo ) {
- case 7: case 8: case 9: /* AES */
- case 10: /* Twofish */
- case 11: case 12: /* Camellia */
- sk->protect.ivlen = 16;
- break;
- default:
- sk->protect.ivlen = 8;
- }
+ sk->protect.ivlen = openpgp_cipher_blocklen (sk->protect.algo);
+ assert (sk->protect.ivlen <= sizeof (temp));
+
if( sk->protect.s2k.mode == 1001 )
sk->protect.ivlen = 0;
else if( sk->protect.s2k.mode == 1002 )