diff options
Diffstat (limited to 'src/lib/libcrypto/x509/x509_vfy.c')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c index b0779db023..701ec565e9 100644 --- a/src/lib/libcrypto/x509/x509_vfy.c +++ b/src/lib/libcrypto/x509/x509_vfy.c | |||
| @@ -153,6 +153,7 @@ static int x509_subject_cmp(X509 **a, X509 **b) | |||
| 153 | int X509_verify_cert(X509_STORE_CTX *ctx) | 153 | int X509_verify_cert(X509_STORE_CTX *ctx) |
| 154 | { | 154 | { |
| 155 | X509 *x,*xtmp,*chain_ss=NULL; | 155 | X509 *x,*xtmp,*chain_ss=NULL; |
| 156 | X509_NAME *xn; | ||
| 156 | int bad_chain = 0; | 157 | int bad_chain = 0; |
| 157 | X509_VERIFY_PARAM *param = ctx->param; | 158 | X509_VERIFY_PARAM *param = ctx->param; |
| 158 | int depth,i,ok=0; | 159 | int depth,i,ok=0; |
| @@ -204,6 +205,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) | |||
| 204 | */ | 205 | */ |
| 205 | 206 | ||
| 206 | /* If we are self signed, we break */ | 207 | /* If we are self signed, we break */ |
| 208 | xn=X509_get_issuer_name(x); | ||
| 207 | if (ctx->check_issued(ctx, x,x)) break; | 209 | if (ctx->check_issued(ctx, x,x)) break; |
| 208 | 210 | ||
| 209 | /* If we were passed a cert chain, use it first */ | 211 | /* If we were passed a cert chain, use it first */ |
| @@ -240,6 +242,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) | |||
| 240 | 242 | ||
| 241 | i=sk_X509_num(ctx->chain); | 243 | i=sk_X509_num(ctx->chain); |
| 242 | x=sk_X509_value(ctx->chain,i-1); | 244 | x=sk_X509_value(ctx->chain,i-1); |
| 245 | xn = X509_get_subject_name(x); | ||
| 243 | if (ctx->check_issued(ctx, x, x)) | 246 | if (ctx->check_issued(ctx, x, x)) |
| 244 | { | 247 | { |
| 245 | /* we have a self signed certificate */ | 248 | /* we have a self signed certificate */ |
| @@ -288,6 +291,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) | |||
| 288 | if (depth < num) break; | 291 | if (depth < num) break; |
| 289 | 292 | ||
| 290 | /* If we are self signed, we break */ | 293 | /* If we are self signed, we break */ |
| 294 | xn=X509_get_issuer_name(x); | ||
| 291 | if (ctx->check_issued(ctx,x,x)) break; | 295 | if (ctx->check_issued(ctx,x,x)) break; |
| 292 | 296 | ||
| 293 | ok = ctx->get_issuer(&xtmp, ctx, x); | 297 | ok = ctx->get_issuer(&xtmp, ctx, x); |
| @@ -306,6 +310,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) | |||
| 306 | } | 310 | } |
| 307 | 311 | ||
| 308 | /* we now have our chain, lets check it... */ | 312 | /* we now have our chain, lets check it... */ |
| 313 | xn=X509_get_issuer_name(x); | ||
| 309 | 314 | ||
| 310 | /* Is last certificate looked up self signed? */ | 315 | /* Is last certificate looked up self signed? */ |
| 311 | if (!ctx->check_issued(ctx,x,x)) | 316 | if (!ctx->check_issued(ctx,x,x)) |
