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 * Deal with PKCS #11 Slots. | 5 * Deal with PKCS #11 Slots. |
6 */ | 6 */ |
7 #include "seccomon.h" | 7 #include "seccomon.h" |
8 #include "secmod.h" | 8 #include "secmod.h" |
9 #include "nssilock.h" | 9 #include "nssilock.h" |
10 #include "secmodi.h" | 10 #include "secmodi.h" |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 | 941 |
942 return; | 942 return; |
943 } | 943 } |
944 | 944 |
945 | 945 |
946 /* | 946 /* |
947 * update a slot to its new attribute according to the slot list | 947 * update a slot to its new attribute according to the slot list |
948 * returns: SECSuccess if nothing to do or add/delete is successful | 948 * returns: SECSuccess if nothing to do or add/delete is successful |
949 */ | 949 */ |
950 SECStatus | 950 SECStatus |
951 PK11_UpdateSlotAttribute(PK11SlotInfo *slot, PK11DefaultArrayEntry *entry, | 951 PK11_UpdateSlotAttribute(PK11SlotInfo *slot, |
952 PRBool add) | 952 const PK11DefaultArrayEntry *entry, |
953 /* add: PR_TRUE if want to turn on */ | 953 PRBool add) |
| 954 /* add: PR_TRUE if want to turn on */ |
954 { | 955 { |
955 SECStatus result = SECSuccess; | 956 SECStatus result = SECSuccess; |
956 PK11SlotList *slotList = PK11_GetSlotList(entry->mechanism); | 957 PK11SlotList *slotList = PK11_GetSlotList(entry->mechanism); |
957 | 958 |
958 if (add) { /* trying to turn on a mechanism */ | 959 if (add) { /* trying to turn on a mechanism */ |
959 | 960 |
960 /* turn on the default flag in the slot */ | 961 /* turn on the default flag in the slot */ |
961 slot->defaultFlags |= entry->flag; | 962 slot->defaultFlags |= entry->flag; |
962 | 963 |
963 /* add this slot to the list */ | 964 /* add this slot to the list */ |
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2389 first_time_set = PR_TRUE; | 2390 first_time_set = PR_TRUE; |
2390 } | 2391 } |
2391 if ((interval-first_time) > timeout) { | 2392 if ((interval-first_time) > timeout) { |
2392 return waitForRemoval ? PK11TokenPresent : PK11TokenRemoved; | 2393 return waitForRemoval ? PK11TokenPresent : PK11TokenRemoved; |
2393 } | 2394 } |
2394 } | 2395 } |
2395 PR_Sleep(latency); | 2396 PR_Sleep(latency); |
2396 } | 2397 } |
2397 return waitForRemoval ? PK11TokenRemoved : PK11TokenPresent; | 2398 return waitForRemoval ? PK11TokenRemoved : PK11TokenPresent; |
2398 } | 2399 } |
OLD | NEW |