| OLD | NEW |
| 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 implements PKCS 11 on top of our existing security modules | 5 * This file implements PKCS 11 on top of our existing security modules |
| 6 * | 6 * |
| 7 * For more information about PKCS 11 See PKCS 11 Token Inteface Standard. | 7 * For more information about PKCS 11 See PKCS 11 Token Inteface Standard. |
| 8 * This implementation has two slots: | 8 * This implementation has two slots: |
| 9 * slot 1 is our generic crypto support. It does not require login. | 9 * slot 1 is our generic crypto support. It does not require login. |
| 10 * It supports Public Key ops, and all they bulk ciphers and hashes. | 10 * It supports Public Key ops, and all they bulk ciphers and hashes. |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 {CKM_CDMF_MAC, {8, 8, CKF_SN_VR}, PR_TRUE}, | 340 {CKM_CDMF_MAC, {8, 8, CKF_SN_VR}, PR_TRUE}, |
| 341 {CKM_CDMF_MAC_GENERAL, {8, 8, CKF_SN_VR}, PR_TRUE}, | 341 {CKM_CDMF_MAC_GENERAL, {8, 8, CKF_SN_VR}, PR_TRUE}, |
| 342 {CKM_CDMF_CBC_PAD, {8, 8, CKF_EN_DE_WR_UN}, PR_TRUE}, | 342 {CKM_CDMF_CBC_PAD, {8, 8, CKF_EN_DE_WR_UN}, PR_TRUE}, |
| 343 /* ------------------------- AES Operations --------------------------- */ | 343 /* ------------------------- AES Operations --------------------------- */ |
| 344 {CKM_AES_KEY_GEN, {16, 32, CKF_GENERATE}, PR_TRUE}, | 344 {CKM_AES_KEY_GEN, {16, 32, CKF_GENERATE}, PR_TRUE}, |
| 345 {CKM_AES_ECB, {16, 32, CKF_EN_DE_WR_UN}, PR_TRUE}, | 345 {CKM_AES_ECB, {16, 32, CKF_EN_DE_WR_UN}, PR_TRUE}, |
| 346 {CKM_AES_CBC, {16, 32, CKF_EN_DE_WR_UN}, PR_TRUE}, | 346 {CKM_AES_CBC, {16, 32, CKF_EN_DE_WR_UN}, PR_TRUE}, |
| 347 {CKM_AES_MAC, {16, 32, CKF_SN_VR}, PR_TRUE}, | 347 {CKM_AES_MAC, {16, 32, CKF_SN_VR}, PR_TRUE}, |
| 348 {CKM_AES_MAC_GENERAL, {16, 32, CKF_SN_VR}, PR_TRUE}, | 348 {CKM_AES_MAC_GENERAL, {16, 32, CKF_SN_VR}, PR_TRUE}, |
| 349 {CKM_AES_CBC_PAD, {16, 32, CKF_EN_DE_WR_UN}, PR_TRUE}, | 349 {CKM_AES_CBC_PAD, {16, 32, CKF_EN_DE_WR_UN}, PR_TRUE}, |
| 350 {CKM_AES_CTS, {16, 32, CKF_EN_DE}, PR_TRUE}, |
| 351 {CKM_AES_CTR, {16, 32, CKF_EN_DE}, PR_TRUE}, |
| 352 {CKM_AES_GCM, {16, 32, CKF_EN_DE}, PR_TRUE}, |
| 350 /* ------------------------- Camellia Operations --------------------- */ | 353 /* ------------------------- Camellia Operations --------------------- */ |
| 351 {CKM_CAMELLIA_KEY_GEN, {16, 32, CKF_GENERATE}, PR_TRUE}, | 354 {CKM_CAMELLIA_KEY_GEN, {16, 32, CKF_GENERATE}, PR_TRUE}, |
| 352 {CKM_CAMELLIA_ECB, {16, 32, CKF_EN_DE_WR_UN}, PR_TRUE}, | 355 {CKM_CAMELLIA_ECB, {16, 32, CKF_EN_DE_WR_UN}, PR_TRUE}, |
| 353 {CKM_CAMELLIA_CBC, {16, 32, CKF_EN_DE_WR_UN}, PR_TRUE}, | 356 {CKM_CAMELLIA_CBC, {16, 32, CKF_EN_DE_WR_UN}, PR_TRUE}, |
| 354 {CKM_CAMELLIA_MAC, {16, 32, CKF_SN_VR}, PR_TRUE}, | 357 {CKM_CAMELLIA_MAC, {16, 32, CKF_SN_VR}, PR_TRUE}, |
| 355 {CKM_CAMELLIA_MAC_GENERAL, {16, 32, CKF_SN_VR}, PR_TRUE}, | 358 {CKM_CAMELLIA_MAC_GENERAL, {16, 32, CKF_SN_VR}, PR_TRUE}, |
| 356 {CKM_CAMELLIA_CBC_PAD, {16, 32, CKF_EN_DE_WR_UN}, PR_TRUE}, | 359 {CKM_CAMELLIA_CBC_PAD, {16, 32, CKF_EN_DE_WR_UN}, PR_TRUE}, |
| 357 /* ------------------------- SEED Operations --------------------------- */ | 360 /* ------------------------- SEED Operations --------------------------- */ |
| 358 {CKM_SEED_KEY_GEN, {16, 16, CKF_GENERATE}, PR_TRUE}, | 361 {CKM_SEED_KEY_GEN, {16, 16, CKF_GENERATE}, PR_TRUE}, |
| 359 {CKM_SEED_ECB, {16, 16, CKF_EN_DE_WR_UN}, PR_TRUE}, | 362 {CKM_SEED_ECB, {16, 16, CKF_EN_DE_WR_UN}, PR_TRUE}, |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 | 607 |
| 605 /* | 608 /* |
| 606 * ******************** Object Creation Utilities *************************** | 609 * ******************** Object Creation Utilities *************************** |
| 607 */ | 610 */ |
| 608 | 611 |
| 609 | 612 |
| 610 /* Make sure a given attribute exists. If it doesn't, initialize it to | 613 /* Make sure a given attribute exists. If it doesn't, initialize it to |
| 611 * value and len | 614 * value and len |
| 612 */ | 615 */ |
| 613 CK_RV | 616 CK_RV |
| 614 sftk_defaultAttribute(SFTKObject *object,CK_ATTRIBUTE_TYPE type,void *value, | 617 sftk_defaultAttribute(SFTKObject *object,CK_ATTRIBUTE_TYPE type, |
| 615 » » » » » » » unsigned int len) | 618 » » » » » const void *value, unsigned int len) |
| 616 { | 619 { |
| 617 if ( !sftk_hasAttribute(object, type)) { | 620 if ( !sftk_hasAttribute(object, type)) { |
| 618 return sftk_AddAttributeType(object,type,value,len); | 621 return sftk_AddAttributeType(object,type,value,len); |
| 619 } | 622 } |
| 620 return CKR_OK; | 623 return CKR_OK; |
| 621 } | 624 } |
| 622 | 625 |
| 623 /* | 626 /* |
| 624 * check the consistancy and initialize a Data Object | 627 * check the consistancy and initialize a Data Object |
| 625 */ | 628 */ |
| (...skipping 4067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4693 | 4696 |
| 4694 | 4697 |
| 4695 CK_RV NSC_WaitForSlotEvent(CK_FLAGS flags, CK_SLOT_ID_PTR pSlot, | 4698 CK_RV NSC_WaitForSlotEvent(CK_FLAGS flags, CK_SLOT_ID_PTR pSlot, |
| 4696 CK_VOID_PTR pReserved) | 4699 CK_VOID_PTR pReserved) |
| 4697 { | 4700 { |
| 4698 CHECK_FORK(); | 4701 CHECK_FORK(); |
| 4699 | 4702 |
| 4700 return CKR_FUNCTION_NOT_SUPPORTED; | 4703 return CKR_FUNCTION_NOT_SUPPORTED; |
| 4701 } | 4704 } |
| 4702 | 4705 |
| OLD | NEW |