summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2013-05-29 15:18:56 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-05-29 15:18:56 -0700
commitff7f8d55717215f09281b3245d1c525333815b63 (patch)
tree74687c733a0b2fd854a4e78f55fd43a1c2fde270 /crypto
parent7f58a20496f9262764d6e0af7e080ae8f6a1eb61 (diff)
parent40630ebf13e02c9ce1121584c84b3c2e4251a822 (diff)
downloadlibcore-ff7f8d55717215f09281b3245d1c525333815b63.zip
libcore-ff7f8d55717215f09281b3245d1c525333815b63.tar.gz
libcore-ff7f8d55717215f09281b3245d1c525333815b63.tar.bz2
am 40630ebf: Merge "NativeCrypto: check that npnProtocols != NULL"
* commit '40630ebf13e02c9ce1121584c84b3c2e4251a822': NativeCrypto: check that npnProtocols != NULL
Diffstat (limited to 'crypto')
-rw-r--r--crypto/src/main/native/org_conscrypt_NativeCrypto.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/crypto/src/main/native/org_conscrypt_NativeCrypto.cpp b/crypto/src/main/native/org_conscrypt_NativeCrypto.cpp
index c6c830f..6013681 100644
--- a/crypto/src/main/native/org_conscrypt_NativeCrypto.cpp
+++ b/crypto/src/main/native/org_conscrypt_NativeCrypto.cpp
@@ -6740,20 +6740,25 @@ static int next_proto_select_callback(SSL* ssl, unsigned char **out, unsigned ch
AppData* appData = toAppData(ssl);
JNI_TRACE("AppData=%p", appData);
unsigned char* npnProtocols = reinterpret_cast<unsigned char*>(appData->npnProtocolsData);
- size_t npnProtocolsLength = appData->npnProtocolsLength;
- JNI_TRACE("npn_protocols=%p, length=%d", npnProtocols, npnProtocolsLength);
-
- int status = SSL_select_next_proto(out, outlen, in, inlen, npnProtocols, npnProtocolsLength);
- switch (status) {
- case OPENSSL_NPN_NEGOTIATED:
- JNI_TRACE("ssl=%p next_proto_select_callback NPN negotiated", ssl);
- break;
- case OPENSSL_NPN_UNSUPPORTED:
- JNI_TRACE("ssl=%p next_proto_select_callback NPN unsupported", ssl);
- break;
- case OPENSSL_NPN_NO_OVERLAP:
- JNI_TRACE("ssl=%p next_proto_select_callback NPN no overlap", ssl);
- break;
+ if (npnProtocols != NULL) {
+ size_t npnProtocolsLength = appData->npnProtocolsLength;
+ JNI_TRACE("npn_protocols=%p, length=%d", npnProtocols, npnProtocolsLength);
+
+ int status = SSL_select_next_proto(out, outlen, in, inlen, npnProtocols,
+ npnProtocolsLength);
+ switch (status) {
+ case OPENSSL_NPN_NEGOTIATED:
+ JNI_TRACE("ssl=%p next_proto_select_callback NPN negotiated", ssl);
+ break;
+ case OPENSSL_NPN_UNSUPPORTED:
+ JNI_TRACE("ssl=%p next_proto_select_callback NPN unsupported", ssl);
+ break;
+ case OPENSSL_NPN_NO_OVERLAP:
+ JNI_TRACE("ssl=%p next_proto_select_callback NPN no overlap", ssl);
+ break;
+ }
+ } else {
+ JNI_TRACE("npn_protocols=NULL");
}
return SSL_TLSEXT_ERR_OK;
}