Bug 536640: Initialize param.iter.type to siBuffer because the ASN.1
encoder and decoder read that field to determine if the SEC_ASN1_INTEGER should be treated as signed or unsigned. Remove a broken comparison of param.iter with def_iter. r=rrelyea. Tag: NSS_3_12_BRANCH git-svn-id: svn://10.0.0.236/branches/NSS_3_12_BRANCH@261004 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
/* $Id: keydb.c,v 1.11 2009-02-03 05:34:44 julien.pierre.boogz%sun.com Exp $ */
|
||||
/* $Id: keydb.c,v 1.11.22.1 2010-08-07 05:49:16 wtc%google.com Exp $ */
|
||||
|
||||
#include "lowkeyi.h"
|
||||
#include "secasn1.h"
|
||||
@@ -1245,10 +1245,6 @@ const SEC_ASN1Template lg_EncryptedDataInfoTemplate[] = {
|
||||
offsetof(LGEncryptedDataInfo,encryptedData) },
|
||||
{ 0 }
|
||||
};
|
||||
static const unsigned char def_iter_data[] = { SEC_ASN1_INTEGER, 0x01, 0x01 };
|
||||
static const SECItem def_iter = { siBuffer ,
|
||||
(unsigned char *)def_iter_data,
|
||||
sizeof(def_iter_data) };
|
||||
|
||||
static SECItem *
|
||||
nsslowkey_EncodePW(SECOidTag alg, const SECItem *salt, SECItem *data)
|
||||
@@ -1262,6 +1258,7 @@ nsslowkey_EncodePW(SECOidTag alg, const SECItem *salt, SECItem *data)
|
||||
SECStatus rv;
|
||||
|
||||
param.salt = *salt;
|
||||
param.iter.type = siBuffer; /* encode as signed integer */
|
||||
param.iter.data = &one;
|
||||
param.iter.len = 1;
|
||||
edi.encryptedData = *data;
|
||||
@@ -1297,6 +1294,7 @@ nsslowkey_DecodePW(const SECItem *derData, SECOidTag *alg, SECItem *salt)
|
||||
SECStatus rv;
|
||||
|
||||
salt->data = NULL;
|
||||
param.iter.type = siBuffer; /* decode as signed integer */
|
||||
|
||||
arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
|
||||
if (arena == NULL) {
|
||||
@@ -1314,9 +1312,6 @@ nsslowkey_DecodePW(const SECItem *derData, SECOidTag *alg, SECItem *salt)
|
||||
if (rv != SECSuccess) {
|
||||
goto loser;
|
||||
}
|
||||
if (SECITEM_ItemsAreEqual(¶m.iter, &def_iter) ) {
|
||||
goto loser;
|
||||
}
|
||||
rv = SECITEM_CopyItem(NULL, salt, ¶m.salt);
|
||||
if (rv != SECSuccess) {
|
||||
goto loser;
|
||||
|
||||
Reference in New Issue
Block a user