Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: nss/lib/softoken/tlsprf.c

Issue 13898013: Update NSS to NSS_3_15_BETA2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: nss/lib/softoken/tlsprf.c
===================================================================
--- nss/lib/softoken/tlsprf.c (revision 195639)
+++ nss/lib/softoken/tlsprf.c (working copy)
@@ -23,6 +23,7 @@
PRUint32 cxDataLen; /* bytes of cxBufPtr containing data. */
SECStatus cxRv; /* records failure of void functions. */
PRBool cxIsFIPS; /* true if conforming to FIPS 198. */
+ HASH_HashType cxHashAlg; /* hash algorithm to use for TLS 1.2+ */
unsigned char cxBuf[512]; /* actual size may be larger than 512. */
} TLSPRFContext;
@@ -89,7 +90,12 @@
sigItem.data = sig;
sigItem.len = maxLen;
- rv = TLS_PRF(&secretItem, NULL, &seedItem, &sigItem, cx->cxIsFIPS);
+ if (cx->cxHashAlg != HASH_AlgNULL) {
+ rv = TLS_P_hash(cx->cxHashAlg, &secretItem, NULL, &seedItem, &sigItem,
+ cx->cxIsFIPS);
+ } else {
+ rv = TLS_PRF(&secretItem, NULL, &seedItem, &sigItem, cx->cxIsFIPS);
+ }
if (rv == SECSuccess && sigLen != NULL)
*sigLen = sigItem.len;
return rv;
@@ -136,7 +142,8 @@
CK_RV
sftk_TLSPRFInit(SFTKSessionContext *context,
SFTKObject * key,
- CK_KEY_TYPE key_type)
+ CK_KEY_TYPE key_type,
+ HASH_HashType hash_alg)
{
SFTKAttribute * keyVal;
TLSPRFContext * prf_cx;
@@ -162,6 +169,7 @@
prf_cx->cxRv = SECSuccess;
prf_cx->cxIsFIPS = (key->slot->slotID == FIPS_SLOT_ID);
prf_cx->cxBufPtr = prf_cx->cxBuf;
+ prf_cx->cxHashAlg = hash_alg;
if (keySize)
PORT_Memcpy(prf_cx->cxBufPtr, keyVal->attrib.pValue, keySize);

Powered by Google App Engine
This is Rietveld 408576698