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

Side by Side Diff: nss/lib/pk11wrap/pk11mech.c

Issue 16132005: Allow NSS to be built with NO_NSPR_10_SUPPORT. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « nss/lib/pk11wrap/pk11auth.c ('k') | nss/lib/pk11wrap/pk11merge.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* This Source Code Form is subject to the terms of the Mozilla Public 1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 /* 4 /*
5 * This file maps various PKCS #11 Mechanisms to related mechanisms, key 5 * This file maps various PKCS #11 Mechanisms to related mechanisms, key
6 * types, and ASN.1 encodings. 6 * types, and ASN.1 encodings.
7 */ 7 */
8 #include "seccomon.h" 8 #include "seccomon.h"
9 #include "secmod.h" 9 #include "secmod.h"
10 #include "secmodi.h" 10 #include "secmodi.h"
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 1128
1129 1129
1130 /* Generate a mechaism param from a type, and iv. */ 1130 /* Generate a mechaism param from a type, and iv. */
1131 SECItem * 1131 SECItem *
1132 PK11_ParamFromAlgid(SECAlgorithmID *algid) 1132 PK11_ParamFromAlgid(SECAlgorithmID *algid)
1133 { 1133 {
1134 CK_RC2_CBC_PARAMS * rc2_cbc_params = NULL; 1134 CK_RC2_CBC_PARAMS * rc2_cbc_params = NULL;
1135 CK_RC2_PARAMS * rc2_ecb_params = NULL; 1135 CK_RC2_PARAMS * rc2_ecb_params = NULL;
1136 CK_RC5_CBC_PARAMS * rc5_cbc_params = NULL; 1136 CK_RC5_CBC_PARAMS * rc5_cbc_params = NULL;
1137 CK_RC5_PARAMS * rc5_ecb_params = NULL; 1137 CK_RC5_PARAMS * rc5_ecb_params = NULL;
1138 PRArenaPool * arena = NULL; 1138 PLArenaPool * arena = NULL;
1139 SECItem * mech = NULL; 1139 SECItem * mech = NULL;
1140 SECOidTag algtag; 1140 SECOidTag algtag;
1141 SECStatus rv; 1141 SECStatus rv;
1142 CK_MECHANISM_TYPE type; 1142 CK_MECHANISM_TYPE type;
1143 /* initialize these to prevent UMRs in the ASN1 decoder. */ 1143 /* initialize these to prevent UMRs in the ASN1 decoder. */
1144 SECItem iv = {siBuffer, NULL, 0}; 1144 SECItem iv = {siBuffer, NULL, 0};
1145 sec_rc2cbcParameter rc2 = { {siBuffer, NULL, 0}, {siBuffer, NULL, 0} }; 1145 sec_rc2cbcParameter rc2 = { {siBuffer, NULL, 0}, {siBuffer, NULL, 0} };
1146 sec_rc5cbcParameter rc5 = { {siBuffer, NULL, 0}, {siBuffer, NULL, 0}, 1146 sec_rc5cbcParameter rc5 = { {siBuffer, NULL, 0}, {siBuffer, NULL, 0},
1147 {siBuffer, NULL, 0}, {siBuffer, NULL, 0} }; 1147 {siBuffer, NULL, 0}, {siBuffer, NULL, 0} };
1148 1148
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 int keyLen = key ? PK11_GetKeyLength(key) : 0; 1511 int keyLen = key ? PK11_GetKeyLength(key) : 0;
1512 1512
1513 return pk11_GenerateNewParamWithKeyLen(type, keyLen); 1513 return pk11_GenerateNewParamWithKeyLen(type, keyLen);
1514 } 1514 }
1515 1515
1516 #define RC5_V10 0x10 1516 #define RC5_V10 0x10
1517 1517
1518 /* turn a PKCS #11 parameter into a DER Encoded Algorithm ID */ 1518 /* turn a PKCS #11 parameter into a DER Encoded Algorithm ID */
1519 SECStatus 1519 SECStatus
1520 PK11_ParamToAlgid(SECOidTag algTag, SECItem *param, 1520 PK11_ParamToAlgid(SECOidTag algTag, SECItem *param,
1521 » » » » PRArenaPool *arena, SECAlgorithmID *algid) { 1521 » » » » PLArenaPool *arena, SECAlgorithmID *algid) {
1522 CK_RC2_CBC_PARAMS *rc2_params; 1522 CK_RC2_CBC_PARAMS *rc2_params;
1523 sec_rc2cbcParameter rc2; 1523 sec_rc2cbcParameter rc2;
1524 CK_RC5_CBC_PARAMS *rc5_params; 1524 CK_RC5_CBC_PARAMS *rc5_params;
1525 sec_rc5cbcParameter rc5; 1525 sec_rc5cbcParameter rc5;
1526 CK_MECHANISM_TYPE type = PK11_AlgtagToMechanism(algTag); 1526 CK_MECHANISM_TYPE type = PK11_AlgtagToMechanism(algTag);
1527 SECItem *newParams = NULL; 1527 SECItem *newParams = NULL;
1528 SECStatus rv = SECFailure; 1528 SECStatus rv = SECFailure;
1529 unsigned long rc2version; 1529 unsigned long rc2version;
1530 1530
1531 switch (type) { 1531 switch (type) {
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 case SEC_OID_MISSI_DSS: 1877 case SEC_OID_MISSI_DSS:
1878 case SEC_OID_MISSI_DSS_OLD: 1878 case SEC_OID_MISSI_DSS_OLD:
1879 case SEC_OID_MISSI_KEA_DSS_OLD: 1879 case SEC_OID_MISSI_KEA_DSS_OLD:
1880 case SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST: 1880 case SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST:
1881 return SEC_OID_ANSIX9_DSA_SIGNATURE; 1881 return SEC_OID_ANSIX9_DSA_SIGNATURE;
1882 default: 1882 default:
1883 break; 1883 break;
1884 } 1884 }
1885 return algTag; 1885 return algTag;
1886 } 1886 }
OLDNEW
« no previous file with comments | « nss/lib/pk11wrap/pk11auth.c ('k') | nss/lib/pk11wrap/pk11merge.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698