summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%google.com <devnull@localhost>2012-11-10 13:06:15 +0000
committerwtc%google.com <devnull@localhost>2012-11-10 13:06:15 +0000
commitb5097d238991353ee58b29686f7ef824edb4587a (patch)
tree9bc1fed177153b401536c73a9bba42dcc316cf15
parent2ddf6bec2d24b0aeb1176a40154ea1f4fa4b58a1 (diff)
downloadnss-hg-b5097d238991353ee58b29686f7ef824edb4587a.tar.gz
Bug 810583: The TLS hello extension handlers for NPN should record the
extension has been negotiated. The patch is contributed by Adam Langley <agl@chromium.org>. r=wtc.
-rw-r--r--security/nss/lib/ssl/ssl3ext.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/security/nss/lib/ssl/ssl3ext.c b/security/nss/lib/ssl/ssl3ext.c
index 6d8ea960c..1dbdcae7e 100644
--- a/security/nss/lib/ssl/ssl3ext.c
+++ b/security/nss/lib/ssl/ssl3ext.c
@@ -535,6 +535,12 @@ ssl3_ServerHandleNextProtoNegoXtn(sslSocket * ss, PRUint16 ex_type, SECItem *dat
return SECFailure;
}
+ ss->xtnData.negotiated[ss->xtnData.numNegotiated++] = ex_type;
+
+ /* TODO: server side NPN support would require calling
+ * ssl3_RegisterServerHelloExtensionSender here in order to echo the
+ * extension back to the client. */
+
return SECSuccess;
}
@@ -603,6 +609,8 @@ ssl3_ClientHandleNextProtoNegoXtn(sslSocket *ss, PRUint16 ex_type,
return SECFailure;
}
+ ss->xtnData.negotiated[ss->xtnData.numNegotiated++] = ex_type;
+
SECITEM_FreeItem(&ss->ssl3.nextProto, PR_FALSE);
return SECITEM_CopyItem(NULL, &ss->ssl3.nextProto, &result);
}