OLD | NEW |
1 /* ***** BEGIN LICENSE BLOCK ***** | 1 /* ***** BEGIN LICENSE BLOCK ***** |
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
3 * | 3 * |
4 * The contents of this file are subject to the Mozilla Public License Version | 4 * The contents of this file are subject to the Mozilla Public License Version |
5 * 1.1 (the "License"); you may not use this file except in compliance with | 5 * 1.1 (the "License"); you may not use this file except in compliance with |
6 * the License. You may obtain a copy of the License at | 6 * the License. You may obtain a copy of the License at |
7 * http://www.mozilla.org/MPL/ | 7 * http://www.mozilla.org/MPL/ |
8 * | 8 * |
9 * Software distributed under the License is distributed on an "AS IS" basis, | 9 * Software distributed under the License is distributed on an "AS IS" basis, |
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 /* subset of attrFlags applicable to the public key */ | 1147 /* subset of attrFlags applicable to the public key */ |
1148 PK11AttrFlags pubKeyAttrFlags = attrFlags & | 1148 PK11AttrFlags pubKeyAttrFlags = attrFlags & |
1149 (PK11_ATTR_TOKEN | PK11_ATTR_SESSION | 1149 (PK11_ATTR_TOKEN | PK11_ATTR_SESSION |
1150 | PK11_ATTR_MODIFIABLE | PK11_ATTR_UNMODIFIABLE); | 1150 | PK11_ATTR_MODIFIABLE | PK11_ATTR_UNMODIFIABLE); |
1151 | 1151 |
1152 if (pk11_BadAttrFlags(attrFlags)) { | 1152 if (pk11_BadAttrFlags(attrFlags)) { |
1153 PORT_SetError( SEC_ERROR_INVALID_ARGS ); | 1153 PORT_SetError( SEC_ERROR_INVALID_ARGS ); |
1154 return NULL; | 1154 return NULL; |
1155 } | 1155 } |
1156 | 1156 |
| 1157 if (!param) { |
| 1158 PORT_SetError( SEC_ERROR_INVALID_ARGS ); |
| 1159 return NULL; |
| 1160 } |
| 1161 |
1157 /* | 1162 /* |
1158 * The opFlags and opFlagMask parameters allow us to control the | 1163 * The opFlags and opFlagMask parameters allow us to control the |
1159 * settings of the key usage attributes (CKA_ENCRYPT and friends). | 1164 * settings of the key usage attributes (CKA_ENCRYPT and friends). |
1160 * opFlagMask is set to one if the flag is specified in opFlags and | 1165 * opFlagMask is set to one if the flag is specified in opFlags and |
1161 * zero if it is to take on a default value calculated by | 1166 * zero if it is to take on a default value calculated by |
1162 * PK11_GenerateKeyPairWithOpFlags. | 1167 * PK11_GenerateKeyPairWithOpFlags. |
1163 * opFlags specifies the actual value of the flag 1 or 0. | 1168 * opFlags specifies the actual value of the flag 1 or 0. |
1164 * Bits not corresponding to one bits in opFlagMask should be zero. | 1169 * Bits not corresponding to one bits in opFlagMask should be zero. |
1165 */ | 1170 */ |
1166 | 1171 |
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2378 for (i=0; i < objCount ; i++) { | 2383 for (i=0; i < objCount ; i++) { |
2379 SECKEYPrivateKey *privKey = | 2384 SECKEYPrivateKey *privKey = |
2380 PK11_MakePrivKey(slot,nullKey,PR_TRUE,key_ids[i],wincx); | 2385 PK11_MakePrivKey(slot,nullKey,PR_TRUE,key_ids[i],wincx); |
2381 SECKEY_AddPrivateKeyToListTail(keys, privKey); | 2386 SECKEY_AddPrivateKeyToListTail(keys, privKey); |
2382 } | 2387 } |
2383 | 2388 |
2384 PORT_Free(key_ids); | 2389 PORT_Free(key_ids); |
2385 return keys; | 2390 return keys; |
2386 } | 2391 } |
2387 | 2392 |
OLD | NEW |