aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g10/ChangeLog5
-rw-r--r--g10/misc.c10
2 files changed, 11 insertions, 4 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 3435f2915..be41ada5a 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-21 Werner Koch <[email protected]>
+
+ * misc.c (openpgp_md_test_algo): Remove rfc2440bis hash algorithms.
+ (openpgp_cipher_test_algo): Likewise for algos 5 and 6.
+
2007-08-02 Werner Koch <[email protected]>
* gpg.c: Include gc-opt-flags.h and remove their definition here.
diff --git a/g10/misc.c b/g10/misc.c
index 2ffe7268d..3781b2c27 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -1,6 +1,6 @@
/* misc.c - miscellaneous functions
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- * 2005, 2006 Free Software Foundation, Inc.
+ * 2005, 2006, 2007 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -331,7 +331,8 @@ print_digest_algo_note( int algo )
int
openpgp_cipher_test_algo( int algo )
{
- if ( algo < 0 || algo > 110 )
+ /* 5 and 6 are marked reserved by rfc2440bis. */
+ if ( algo < 0 || algo > 110 || algo == 5 || algo == 6 )
return gpg_error (GPG_ERR_CIPHER_ALGO);
return gcry_cipher_test_algo (algo);
}
@@ -396,8 +397,9 @@ openpgp_md_test_algo( int algo )
/* Note: If the list of actual supported OpenPGP algorithms changes,
make sure that our hard coded values at
print_status_begin_signing() gets updated. */
-
- if (algo < 0 || algo > 110)
+ /* 4, 5, 6, 7 are defined by rfc2440 but will be removed from the
+ next revision of the standard. */
+ if (algo < 0 || algo > 110 || (algo >= 4 && algo <= 7))
return gpg_error (GPG_ERR_DIGEST_ALGO);
return gcry_md_test_algo (algo);
}