Skip to content

Commit 65024b1

Browse files
committed
Fix xfcc_integration_test by correcting SSL_get0_peer_certificate in bssl-compat
1 parent 4018cea commit 65024b1

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

bssl-compat/patch/include/openssl/pool.h.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ set -euo pipefail
55
uncomment.sh "$1" --comment -h \
66
--uncomment-func-decl 'CRYPTO_BUFFER_new' \
77
--uncomment-func-decl 'CRYPTO_BUFFER_free' \
8-
--uncomment-regex 'BORINGSSL_MAKE_DELETER(CRYPTO_BUFFER,'
8+
--uncomment-regex 'BORINGSSL_MAKE_DELETER(CRYPTO_BUFFER,' \
9+
--uncomment-regex 'DEFINE_STACK_OF(CRYPTO_BUFFER)'

bssl-compat/source/SSL_get0_peer_certificates.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
#include <openssl/ssl.h>
22
#include <ossl.h>
33

4-
STACK_OF(CRYPTO_BUFFER) *criptoBuffer;
4+
// Dummy buffer just to return a non null value in SSL_get0_peer_certificates
5+
STACK_OF(CRYPTO_BUFFER) *criptoBuffer = NULL;
56

67
const STACK_OF(CRYPTO_BUFFER) *SSL_get0_peer_certificates(const SSL *ssl) {
78
STACK_OF(X509) *x509Temp = SSL_get_peer_cert_chain(ssl);
89
if(x509Temp == NULL)
910
return NULL;
10-
else
11+
else {
12+
if(criptoBuffer == NULL) {
13+
criptoBuffer = sk_CRYPTO_BUFFER_new_null();
14+
}
1115
return criptoBuffer;
16+
}
1217
}
13-

0 commit comments

Comments
 (0)