1
From: Raphael Geissert <geissert@debian.org>
2
Description: make X509_verify_cert indicate that any certificate whose
3
name contains "DigiNotar" is revoked.
6
Last-Update: 2011-09-08
7
Bug: http://bugs.debian.org/639744
8
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
9
Reviewed-by: Dr Stephen N Henson <shenson@drh-consultancy.co.uk>
11
This is not meant as final patch.
13
Index: openssl-1.0.0d/crypto/x509/x509_vfy.c
14
===================================================================
15
--- openssl-1.0.0d.orig/crypto/x509/x509_vfy.c
16
+++ openssl-1.0.0d/crypto/x509/x509_vfy.c
17
@@ -117,6 +117,7 @@ static int check_trust(X509_STORE_CTX *c
18
static int check_revocation(X509_STORE_CTX *ctx);
19
static int check_cert(X509_STORE_CTX *ctx);
20
static int check_policy(X509_STORE_CTX *ctx);
21
+static int check_ca_blacklist(X509_STORE_CTX *ctx);
23
static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer,
24
unsigned int *preasons,
25
@@ -374,6 +375,9 @@ int X509_verify_cert(X509_STORE_CTX *ctx
26
ok=internal_verify(ctx);
29
+ ok = check_ca_blacklist(ctx);
32
#ifndef OPENSSL_NO_RFC3779
33
/* RFC 3779 path validation, now that CRL check has been done */
34
ok = v3_asid_validate_path(ctx);
35
@@ -820,6 +824,29 @@ static int check_crl_time(X509_STORE_CTX
39
+static int check_ca_blacklist(X509_STORE_CTX *ctx)
43
+ /* Check all certificates against the blacklist */
44
+ for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
46
+ x = sk_X509_value(ctx->chain, i);
47
+ /* Mark DigiNotar certificates as revoked, no matter
48
+ * where in the chain they are.
50
+ if (x->name && strstr(x->name, "DigiNotar"))
52
+ ctx->error = X509_V_ERR_CERT_REVOKED;
53
+ ctx->error_depth = i;
54
+ ctx->current_cert = x;
55
+ if (!ctx->verify_cb(0,ctx))
62
static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl,
63
X509 **pissuer, int *pscore, unsigned int *preasons,
64
STACK_OF(X509_CRL) *crls)