summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%google.com <devnull@localhost>2012-03-31 23:16:38 +0000
committerwtc%google.com <devnull@localhost>2012-03-31 23:16:38 +0000
commit10adb6ce8098e713c658c420bb053a7e7faca5bc (patch)
treec4bd5c43f384fa134ada7d0e9da29b71031c8753
parentf722c12a62735d9512cfa0b21280e5ce143b2ee6 (diff)
downloadnss-hg-10adb6ce8098e713c658c420bb053a7e7faca5bc.tar.gz
Bug 734534: Fix nits in the next protocol negotiation (NPN) functions.NSS_3_13_4_BETA1
r=agl. Tag: NSS_3_13_4_BRANCH
-rw-r--r--security/nss/lib/ssl/sslsock.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/security/nss/lib/ssl/sslsock.c b/security/nss/lib/ssl/sslsock.c
index c1295a7f5..bc915bf55 100644
--- a/security/nss/lib/ssl/sslsock.c
+++ b/security/nss/lib/ssl/sslsock.c
@@ -1303,7 +1303,7 @@ SSL_SetNextProtoCallback(PRFileDesc *fd, SSLNextProtoCallback callback,
return SECSuccess;
}
-/* NextProtoStandardCallback is set as an NPN callback for the case when
+/* ssl_NextProtoNegoCallback is set as an NPN callback for the case when
* SSL_SetNextProtoNego is used.
*/
static SECStatus
@@ -1349,12 +1349,12 @@ pick_first:
result = ss->opt.nextProtoNego.data;
found:
- *protoOutLen = result[0];
if (protoMaxLen < result[0]) {
PORT_SetError(SEC_ERROR_OUTPUT_LEN);
return SECFailure;
}
memcpy(protoOut, result + 1, result[0]);
+ *protoOutLen = result[0];
return SECSuccess;
}
@@ -1408,13 +1408,12 @@ SSL_GetNextProto(PRFileDesc *fd, SSLNextProtoState *state, unsigned char *buf,
if (ss->ssl3.nextProtoState != SSL_NEXT_PROTO_NO_SUPPORT &&
ss->ssl3.nextProto.data) {
- *bufLen = ss->ssl3.nextProto.len;
- if (*bufLen > bufLenMax) {
+ if (ss->ssl3.nextProto.len > bufLenMax) {
PORT_SetError(SEC_ERROR_OUTPUT_LEN);
- *bufLen = 0;
return SECFailure;
}
PORT_Memcpy(buf, ss->ssl3.nextProto.data, ss->ssl3.nextProto.len);
+ *bufLen = ss->ssl3.nextProto.len;
} else {
*bufLen = 0;
}