summaryrefslogtreecommitdiffstats
path: root/g10/misc.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2007-08-22 12:55:07 +0200
committerWerner Koch <wk@gnupg.org>2007-08-22 12:55:07 +0200
commitf81f521a72ccbccf2b66c4b7ce96021de90c9e29 (patch)
treed5335291ab12819087ea12e250cbf4241c703749 /g10/misc.c
parentPost release version number bump (diff)
downloadgnupg2-f81f521a72ccbccf2b66c4b7ce96021de90c9e29.tar.xz
gnupg2-f81f521a72ccbccf2b66c4b7ce96021de90c9e29.zip
Updated estream.
More changes for Windows.
Diffstat (limited to 'g10/misc.c')
-rw-r--r--g10/misc.c10
1 files changed, 6 insertions, 4 deletions
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);
}