From: Nikos Mavrogiannopoulos Date: Fri, 28 May 2010 18:37:58 +0000 (+0200) Subject: Added support for SHA224 and SHA256 in DSA. X-Git-Tag: gnutls_2_11_3~238 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=204b7b78899456945151ce88dbc41e7cb9eba994;p=thirdparty%2Fgnutls.git Added support for SHA224 and SHA256 in DSA. --- diff --git a/NEWS b/NEWS index de08cd55fb..e23313c9ea 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ See the end for copying conditions. * Version 2.11.0 (unreleased) +** libgnutls: Added support for DSA-SHA256 and DSA-SHA224 + ** libgnutls: Added PKCS #11 support and an API to access objects in gnutls/pkcs11.h. Currently certificates and public keys can be imported from tokens, and operations can be performed on private keys. diff --git a/lib/gnutls_algorithms.c b/lib/gnutls_algorithms.c index 08c2ad9032..1f7492aea0 100644 --- a/lib/gnutls_algorithms.c +++ b/lib/gnutls_algorithms.c @@ -1961,6 +1961,10 @@ static const gnutls_sign_entry sign_algorithms[] = { GNUTLS_MAC_RMD160, TLS_SIGN_AID_UNKNOWN}, {"DSA-SHA1", SIG_DSA_SHA1_OID, GNUTLS_SIGN_DSA_SHA1, GNUTLS_PK_DSA, GNUTLS_MAC_SHA1, {2, 2}}, + {"DSA-SHA224", SIG_DSA_SHA224_OID, GNUTLS_SIGN_DSA_SHA224, GNUTLS_PK_DSA, + GNUTLS_MAC_SHA224, {3, 2}}, + {"DSA-SHA256", SIG_DSA_SHA256_OID, GNUTLS_SIGN_DSA_SHA256, GNUTLS_PK_DSA, + GNUTLS_MAC_SHA256, {4, 2}}, {"RSA-MD5", SIG_RSA_MD5_OID, GNUTLS_SIGN_RSA_MD5, GNUTLS_PK_RSA, GNUTLS_MAC_MD5, {1, 1}}, {"RSA-MD2", SIG_RSA_MD2_OID, GNUTLS_SIGN_RSA_MD2, GNUTLS_PK_RSA, @@ -2321,3 +2325,4 @@ _gnutls_x509_pk_to_oid (gnutls_pk_algorithm_t algorithm) return ret; } + diff --git a/lib/includes/gnutls/gnutls.h.in b/lib/includes/gnutls/gnutls.h.in index 3cb961165d..df63cb8786 100644 --- a/lib/includes/gnutls/gnutls.h.in +++ b/lib/includes/gnutls/gnutls.h.in @@ -569,6 +569,8 @@ extern "C" * @GNUTLS_SIGN_RSA_SHA1: Digital signature algorithm RSA with SHA-1 * @GNUTLS_SIGN_RSA_SHA: Same as %GNUTLS_SIGN_RSA_SHA1. * @GNUTLS_SIGN_DSA_SHA1: Digital signature algorithm DSA with SHA-1 + * @GNUTLS_SIGN_DSA_SHA224: Digital signature algorithm DSA with SHA-224 + * @GNUTLS_SIGN_DSA_SHA256: Digital signature algorithm DSA with SHA-256 * @GNUTLS_SIGN_DSA_SHA: Same as %GNUTLS_SIGN_DSA_SHA1. * @GNUTLS_SIGN_RSA_MD5: Digital signature algorithm RSA with MD5. * @GNUTLS_SIGN_RSA_MD2: Digital signature algorithm RSA with MD2. @@ -593,7 +595,9 @@ extern "C" GNUTLS_SIGN_RSA_SHA256 = 6, GNUTLS_SIGN_RSA_SHA384 = 7, GNUTLS_SIGN_RSA_SHA512 = 8, - GNUTLS_SIGN_RSA_SHA224 = 9 + GNUTLS_SIGN_RSA_SHA224 = 9, + GNUTLS_SIGN_DSA_SHA224 = 10, + GNUTLS_SIGN_DSA_SHA256 = 11, } gnutls_sign_algorithm_t; const char *gnutls_sign_algorithm_get_name (gnutls_sign_algorithm_t sign); diff --git a/lib/x509/common.h b/lib/x509/common.h index 960906a162..67124f37f8 100644 --- a/lib/x509/common.h +++ b/lib/x509/common.h @@ -49,6 +49,10 @@ /* signature OIDs */ #define SIG_DSA_SHA1_OID "1.2.840.10040.4.3" +/* those two from draft-ietf-pkix-sha2-dsa-ecdsa-06 */ +#define SIG_DSA_SHA224_OID "2.16.840.1.101.3.4.3.1" +#define SIG_DSA_SHA256_OID "2.16.840.1.101.3.4.3.2" + #define SIG_RSA_MD5_OID "1.2.840.113549.1.1.4" #define SIG_RSA_MD2_OID "1.2.840.113549.1.1.2" #define SIG_RSA_SHA1_OID "1.2.840.113549.1.1.5"