@itemize
@item @code{GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD2}
@item @code{GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5}
+@item @code{GNUTLS_VERIFY_ALLOW_SIGN_WITH_SHA1}
@item @code{GNUTLS_VERIFY_ALLOW_BROKEN}
@end itemize
as in the following example:
@item %VERIFY_ALLOW_SIGN_RSA_MD5 @tab
will allow RSA-MD5 signatures in certificate chains.
+@item %VERIFY_ALLOW_SIGN_WITH_SHA1 @tab
+will allow signatures with SHA1 hash algorithm in certificate chains.
+
@item %VERIFY_DISABLE_CRL_CHECKS @tab
will disable CRL or OCSP checks in the verification of the certificate chain.
* using the broken MD2 algorithm.
* @GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5: Allow certificates to be signed
* using the broken MD5 algorithm.
+ * @GNUTLS_VERIFY_ALLOW_SIGN_WITH_SHA1: Allow certificates to be signed
+ * using the broken SHA1 hash algorithm.
* @GNUTLS_VERIFY_ALLOW_BROKEN: Allow certificates to be signed
* using any broken algorithm.
* @GNUTLS_VERIFY_DISABLE_TIME_CHECKS: Disable checking of activation
GNUTLS_VERIFY_DO_NOT_ALLOW_UNSORTED_CHAIN = 1 << 11,
GNUTLS_VERIFY_DO_NOT_ALLOW_WILDCARDS = 1 << 12,
GNUTLS_VERIFY_USE_TLS1_RSA = 1 << 13,
- GNUTLS_VERIFY_IGNORE_UNKNOWN_CRIT_EXTENSIONS = 1 << 14
+ GNUTLS_VERIFY_IGNORE_UNKNOWN_CRIT_EXTENSIONS = 1 << 14,
+ GNUTLS_VERIFY_ALLOW_SIGN_WITH_SHA1 = 1 << 15,
/* cannot exceed 2^24 due to GNUTLS_PROFILE_TO_VFLAGS() */
} gnutls_certificate_verify_flags;
c->additional_verify_flags |=
GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5;
}
+static void enable_verify_allow_sha1(gnutls_priority_t c)
+{
+ c->additional_verify_flags |=
+ GNUTLS_VERIFY_ALLOW_SIGN_WITH_SHA1;
+}
static void enable_verify_allow_broken(gnutls_priority_t c)
{
c->additional_verify_flags |=
STATELESS_COMPRESSION, enable_stateless_compression
VERIFY_ALLOW_BROKEN, enable_verify_allow_broken
VERIFY_ALLOW_SIGN_RSA_MD5, enable_verify_allow_rsa_md5
+VERIFY_ALLOW_SIGN_WITH_SHA1, enable_verify_allow_sha1
VERIFY_DISABLE_CRL_CHECKS, disable_crl_checks
SSL3_RECORD_VERSION, enable_ssl3_record_version
LATEST_RECORD_VERSION, enable_latest_record_version
static
int is_broken_allowed(gnutls_sign_algorithm_t sig, unsigned int flags)
{
+ gnutls_digest_algorithm_t hash;
+
+ /* we have a catch all */
+ if ((flags & GNUTLS_VERIFY_ALLOW_BROKEN) == GNUTLS_VERIFY_ALLOW_BROKEN)
+ return 1;
+
/* the first two are for backwards compatibility */
if ((sig == GNUTLS_SIGN_RSA_MD2)
&& (flags & GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD2))
if ((sig == GNUTLS_SIGN_RSA_MD5)
&& (flags & GNUTLS_VERIFY_ALLOW_SIGN_RSA_MD5))
return 1;
- /* we no longer have individual flags - but rather a catch all */
- if ((flags & GNUTLS_VERIFY_ALLOW_BROKEN) == GNUTLS_VERIFY_ALLOW_BROKEN)
+
+ hash = gnutls_sign_get_hash_algorithm(sig);
+ if (hash == GNUTLS_DIG_SHA1 && (flags & GNUTLS_VERIFY_ALLOW_SIGN_WITH_SHA1))
return 1;
+
return 0;
}