summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libssl/ssl/ssltest.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/regress/lib/libssl/ssl/ssltest.c b/src/regress/lib/libssl/ssl/ssltest.c
index f5203b0713..d31642d6c5 100644
--- a/src/regress/lib/libssl/ssl/ssltest.c
+++ b/src/regress/lib/libssl/ssl/ssltest.c
@@ -1,4 +1,4 @@
1/* ssl/ssltest.c */ 1/* $OpenBSD: ssltest.c,v 1.31 2021/10/31 16:56:17 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1390,24 +1390,27 @@ get_proxy_auth_ex_data_idx(void)
1390static int 1390static int
1391verify_callback(int ok, X509_STORE_CTX *ctx) 1391verify_callback(int ok, X509_STORE_CTX *ctx)
1392{ 1392{
1393 X509 *xs;
1393 char *s, buf[256]; 1394 char *s, buf[256];
1395 int error, error_depth;
1394 1396
1395 s = X509_NAME_oneline(X509_get_subject_name(ctx->current_cert), buf, 1397 xs = X509_STORE_CTX_get_current_cert(ctx);
1396 sizeof buf); 1398 s = X509_NAME_oneline(X509_get_subject_name(xs), buf, sizeof buf);
1399 error = X509_STORE_CTX_get_error(ctx);
1400 error_depth = X509_STORE_CTX_get_error_depth(ctx);
1397 if (s != NULL) { 1401 if (s != NULL) {
1398 if (ok) 1402 if (ok)
1399 fprintf(stderr, "depth=%d %s\n", 1403 fprintf(stderr, "depth=%d %s\n", error_depth, buf);
1400 ctx->error_depth, buf);
1401 else { 1404 else {
1402 fprintf(stderr, "depth=%d error=%d %s\n", 1405 fprintf(stderr, "depth=%d error=%d %s\n", error_depth,
1403 ctx->error_depth, ctx->error, buf); 1406 error, buf);
1404 } 1407 }
1405 } 1408 }
1406 1409
1407 if (ok == 0) { 1410 if (ok == 0) {
1408 fprintf(stderr, "Error string: %s\n", 1411 fprintf(stderr, "Error string: %s\n",
1409 X509_verify_cert_error_string(ctx->error)); 1412 X509_verify_cert_error_string(error));
1410 switch (ctx->error) { 1413 switch (error) {
1411 case X509_V_ERR_CERT_NOT_YET_VALID: 1414 case X509_V_ERR_CERT_NOT_YET_VALID:
1412 case X509_V_ERR_CERT_HAS_EXPIRED: 1415 case X509_V_ERR_CERT_HAS_EXPIRED:
1413 case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: 1416 case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
@@ -1417,12 +1420,7 @@ verify_callback(int ok, X509_STORE_CTX *ctx)
1417 } 1420 }
1418 1421
1419 if (ok == 1) { 1422 if (ok == 1) {
1420 X509 *xs = ctx->current_cert; 1423 if (X509_get_extension_flags(xs) & EXFLAG_PROXY) {
1421#if 0
1422 X509 *xi = ctx->current_issuer;
1423#endif
1424
1425 if (xs->ex_flags & EXFLAG_PROXY) {
1426 unsigned int *letters = 1424 unsigned int *letters =
1427 X509_STORE_CTX_get_ex_data(ctx, 1425 X509_STORE_CTX_get_ex_data(ctx,
1428 get_proxy_auth_ex_data_idx()); 1426 get_proxy_auth_ex_data_idx());
@@ -1760,16 +1758,19 @@ app_verify_callback(X509_STORE_CTX *ctx, void *arg)
1760 unsigned int letters[26]; /* only used with proxy_auth */ 1758 unsigned int letters[26]; /* only used with proxy_auth */
1761 1759
1762 if (cb_arg->app_verify) { 1760 if (cb_arg->app_verify) {
1761 X509 *xs;
1763 char *s = NULL, buf[256]; 1762 char *s = NULL, buf[256];
1764 1763
1764 xs = X509_STORE_CTX_get0_cert(ctx);
1765 fprintf(stderr, "In app_verify_callback, allowing cert. "); 1765 fprintf(stderr, "In app_verify_callback, allowing cert. ");
1766 fprintf(stderr, "Arg is: %s\n", cb_arg->string); 1766 fprintf(stderr, "Arg is: %s\n", cb_arg->string);
1767 fprintf(stderr, "Finished printing do we have a context? 0x%p a cert? 0x%p\n", 1767 fprintf(stderr, "Finished printing do we have a context? 0x%p a cert? 0x%p\n",
1768 (void *)ctx, (void *)ctx->cert); 1768 (void *)ctx, (void *)xs);
1769 if (ctx->cert) 1769 if (xs)
1770 s = X509_NAME_oneline(X509_get_subject_name(ctx->cert), buf, 256); 1770 s = X509_NAME_oneline(X509_get_subject_name(xs), buf, 256);
1771 if (s != NULL) { 1771 if (s != NULL) {
1772 fprintf(stderr, "cert depth=%d %s\n", ctx->error_depth, buf); 1772 fprintf(stderr, "cert depth=%d %s\n",
1773 X509_STORE_CTX_get_error_depth(ctx), buf);
1773 } 1774 }
1774 return (1); 1775 return (1);
1775 } 1776 }