import NSS tip revs: bug1594965, bug1593167, bug1603027, bug1600144, bug1590001, bug1603257, bug1605545, bug1513586

This commit is contained in:
Roy Tam 2020-01-03 22:08:56 +08:00
commit 9778f15c7d
10 changed files with 285 additions and 41 deletions

View file

@ -7,6 +7,7 @@
#include "nss.h"
#include "pk11func.h"
#include "secder.h"
#include "sechash.h"
#include "ssl.h"
#include "sslproto.h"
#include "sslimpl.h"
@ -538,6 +539,15 @@ tls13_MakePssSpki(const SECKEYPublicKey *pub, SECOidTag hashOid)
goto loser; /* Code already set. */
}
/* Always include saltLength: all hashes are larger than 20. */
unsigned int saltLength = HASH_ResultLenByOidTag(hashOid);
PORT_Assert(saltLength > 20);
if (!SEC_ASN1EncodeInteger(arena, &params.saltLength, saltLength)) {
PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
goto loser;
}
/* Omit the trailerField always. */
SECItem *algorithmItem =
SEC_ASN1EncodeItem(arena, NULL, &params,
SEC_ASN1_GET(SECKEY_RSAPSSParamsTemplate));
@ -752,6 +762,8 @@ SSLExp_DelegateCredential(const CERTCertificate *cert,
goto loser;
}
PRINT_BUF(20, (NULL, "delegated credential", dcBuf.buf, dcBuf.len));
SECKEY_DestroySubjectPublicKeyInfo(spki);
SECKEY_DestroyPrivateKey(tmpPriv);
tls13_DestroyDelegatedCredential(dc);