summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbeck <>2021-10-23 20:42:50 +0000
committerbeck <>2021-10-23 20:42:50 +0000
commit294ec6eff6667e3e978a71ce4219ef96214e4b98 (patch)
tree29525b524ab0802402e6cb477926f195db081bea /src
parentc47d838425ca8bf46524f3d2c215287091f3e2aa (diff)
downloadopenbsd-294ec6eff6667e3e978a71ce4219ef96214e4b98.tar.gz
openbsd-294ec6eff6667e3e978a71ce4219ef96214e4b98.tar.bz2
openbsd-294ec6eff6667e3e978a71ce4219ef96214e4b98.zip
Add SSL_get0_verified_chain - needed by some new stuff
symbol will be exposed with tb@'s forthcoming bump ok tb@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/ssl.h3
-rw-r--r--src/lib/libssl/ssl_cert.c11
-rw-r--r--src/lib/libssl/ssl_lib.c8
-rw-r--r--src/lib/libssl/ssl_locl.h3
4 files changed, 21 insertions, 4 deletions
diff --git a/src/lib/libssl/ssl.h b/src/lib/libssl/ssl.h
index a6ab4fc2f6..258cde67e4 100644
--- a/src/lib/libssl/ssl.h
+++ b/src/lib/libssl/ssl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl.h,v 1.213 2021/10/23 16:29:15 beck Exp $ */ 1/* $OpenBSD: ssl.h,v 1.214 2021/10/23 20:42:50 beck 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 *
@@ -513,6 +513,7 @@ int SSL_set_num_tickets(SSL *s, size_t num_tickets);
513size_t SSL_get_num_tickets(const SSL *s); 513size_t SSL_get_num_tickets(const SSL *s);
514int SSL_CTX_set_num_tickets(SSL_CTX *ctx, size_t num_tickets); 514int SSL_CTX_set_num_tickets(SSL_CTX *ctx, size_t num_tickets);
515size_t SSL_CTX_get_num_tickets(const SSL_CTX *ctx); 515size_t SSL_CTX_get_num_tickets(const SSL_CTX *ctx);
516STACK_OF(X509) *SSL_get0_verified_chain(const SSL *s);
516#endif 517#endif
517 518
518#ifndef LIBRESSL_INTERNAL 519#ifndef LIBRESSL_INTERNAL
diff --git a/src/lib/libssl/ssl_cert.c b/src/lib/libssl/ssl_cert.c
index a711b5db5c..4c39925c60 100644
--- a/src/lib/libssl/ssl_cert.c
+++ b/src/lib/libssl/ssl_cert.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_cert.c,v 1.85 2021/10/23 16:11:30 tb Exp $ */ 1/* $OpenBSD: ssl_cert.c,v 1.86 2021/10/23 20:42:50 beck 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 *
@@ -447,6 +447,15 @@ ssl_verify_cert_chain(SSL *s, STACK_OF(X509) *sk)
447 ret = X509_verify_cert(ctx); 447 ret = X509_verify_cert(ctx);
448 448
449 s->verify_result = X509_STORE_CTX_get_error(ctx); 449 s->verify_result = X509_STORE_CTX_get_error(ctx);
450 sk_X509_pop_free(s->internal->verified_chain, X509_free);
451 s->internal->verified_chain = NULL;
452 if (X509_STORE_CTX_get0_chain(ctx) != NULL) {
453 s->internal->verified_chain = X509_STORE_CTX_get1_chain(ctx);
454 if (s->internal->verified_chain == NULL) {
455 SSLerrorx(ERR_R_MALLOC_FAILURE);
456 ret = 0;
457 }
458 }
450 459
451 err: 460 err:
452 X509_STORE_CTX_free(ctx); 461 X509_STORE_CTX_free(ctx);
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c
index 3c7bdfd265..cfd5c9bfb8 100644
--- a/src/lib/libssl/ssl_lib.c
+++ b/src/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_lib.c,v 1.274 2021/10/23 16:29:15 beck Exp $ */ 1/* $OpenBSD: ssl_lib.c,v 1.275 2021/10/23 20:42:50 beck 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 *
@@ -900,6 +900,12 @@ SSL_get_peer_cert_chain(const SSL *s)
900 return (r); 900 return (r);
901} 901}
902 902
903STACK_OF(X509) *
904SSL_get0_verified_chain(const SSL *s)
905{
906 return s->internal->verified_chain;
907}
908
903/* 909/*
904 * Now in theory, since the calling process own 't' it should be safe to 910 * Now in theory, since the calling process own 't' it should be safe to
905 * modify. We need to be able to read f without being hassled 911 * modify. We need to be able to read f without being hassled
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h
index 579899f464..aa6233e617 100644
--- a/src/lib/libssl/ssl_locl.h
+++ b/src/lib/libssl/ssl_locl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_locl.h,v 1.365 2021/10/23 16:29:15 beck Exp $ */ 1/* $OpenBSD: ssl_locl.h,v 1.366 2021/10/23 20:42:50 beck 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 *
@@ -1031,6 +1031,7 @@ typedef struct ssl_internal_st {
1031 int empty_record_count; 1031 int empty_record_count;
1032 1032
1033 size_t num_tickets; /* Unused, for OpenSSL compatibility */ 1033 size_t num_tickets; /* Unused, for OpenSSL compatibility */
1034 STACK_OF(X509) *verified_chain;
1034} SSL_INTERNAL; 1035} SSL_INTERNAL;
1035 1036
1036struct ssl_st { 1037struct ssl_st {