~ubuntu-branches/ubuntu/natty/nss/natty-security

« back to all changes in this revision

Viewing changes to mozilla/security/nss/lib/softoken/legacydb/keydb.c

Tags: 3.12.8-0ubuntu0.10.10.1
* New upstream release v3.12.8 (NSS_3_12_8_RTM)
  - Fix browser wildcard certificate validation issue
  - Update root certs
  - Fix SSL deadlocks
* Refresh patches:
  - update debian/patches/38_kbsd.patch
  - update debian/patches/97_SSL_RENEGOTIATE_TRANSITIONAL.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
 * the terms of any one of the MPL, the GPL or the LGPL.
35
35
 *
36
36
 * ***** END LICENSE BLOCK ***** */
37
 
/* $Id: keydb.c,v 1.11 2009/02/03 05:34:44 julien.pierre.boogz%sun.com Exp $ */
 
37
/* $Id: keydb.c,v 1.11.22.1 2010/08/07 05:49:16 wtc%google.com Exp $ */
38
38
 
39
39
#include "lowkeyi.h"
40
40
#include "secasn1.h"
1245
1245
        offsetof(LGEncryptedDataInfo,encryptedData) },
1246
1246
    { 0 }
1247
1247
};
1248
 
static const unsigned char def_iter_data[] = { SEC_ASN1_INTEGER, 0x01, 0x01 };
1249
 
static const SECItem def_iter = { siBuffer , 
1250
 
                                (unsigned char *)def_iter_data, 
1251
 
                                sizeof(def_iter_data) };
1252
1248
 
1253
1249
static SECItem *
1254
1250
nsslowkey_EncodePW(SECOidTag alg, const SECItem *salt, SECItem *data)
1262
1258
    SECStatus rv;
1263
1259
 
1264
1260
    param.salt = *salt;
 
1261
    param.iter.type = siBuffer;  /* encode as signed integer */
1265
1262
    param.iter.data = &one;
1266
1263
    param.iter.len = 1;
1267
1264
    edi.encryptedData = *data;
1297
1294
    SECStatus rv;
1298
1295
 
1299
1296
    salt->data = NULL;
 
1297
    param.iter.type = siBuffer;  /* decode as signed integer */
1300
1298
 
1301
1299
    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
1302
1300
    if (arena == NULL) {
1314
1312
    if (rv != SECSuccess) {
1315
1313
        goto loser;
1316
1314
    }
1317
 
    if (SECITEM_ItemsAreEqual(&param.iter, &def_iter) ) {
1318
 
        goto loser;
1319
 
    }
1320
1315
    rv = SECITEM_CopyItem(NULL, salt, &param.salt);
1321
1316
    if (rv != SECSuccess) {
1322
1317
        goto loser;