| 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 /* | 5 /* |
| 6 * object.c | 6 * object.c |
| 7 * | 7 * |
| 8 * This file implements the NSSCKFWObject type and methods. | 8 * This file implements the NSSCKFWObject type and methods. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 164 |
| 165 fwObject->fwToken = fwToken; | 165 fwObject->fwToken = fwToken; |
| 166 fwObject->mdToken = nssCKFWToken_GetMDToken(fwToken); | 166 fwObject->mdToken = nssCKFWToken_GetMDToken(fwToken); |
| 167 fwObject->fwInstance = fwInstance; | 167 fwObject->fwInstance = fwInstance; |
| 168 fwObject->mdInstance = nssCKFWInstance_GetMDInstance(fwInstance); | 168 fwObject->mdInstance = nssCKFWInstance_GetMDInstance(fwInstance); |
| 169 fwObject->mutex = nssCKFWInstance_CreateMutex(fwInstance, arena, pError); | 169 fwObject->mutex = nssCKFWInstance_CreateMutex(fwInstance, arena, pError); |
| 170 if (!fwObject->mutex) { | 170 if (!fwObject->mutex) { |
| 171 if( CKR_OK == *pError ) { | 171 if( CKR_OK == *pError ) { |
| 172 *pError = CKR_GENERAL_ERROR; | 172 *pError = CKR_GENERAL_ERROR; |
| 173 } | 173 } |
| 174 nss_ZFreeIf(fwObject); |
| 174 return (NSSCKFWObject *)NULL; | 175 return (NSSCKFWObject *)NULL; |
| 175 } | 176 } |
| 176 | 177 |
| 177 *pError = nssCKFWHash_Add(mdObjectHash, mdObject, fwObject); | 178 *pError = nssCKFWHash_Add(mdObjectHash, mdObject, fwObject); |
| 178 if( CKR_OK != *pError ) { | 179 if( CKR_OK != *pError ) { |
| 179 nss_ZFreeIf(fwObject); | 180 nss_ZFreeIf(fwObject); |
| 180 return (NSSCKFWObject *)NULL; | 181 return (NSSCKFWObject *)NULL; |
| 181 } | 182 } |
| 182 | 183 |
| 183 #ifdef DEBUG | 184 #ifdef DEBUG |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1014 } | 1015 } |
| 1015 | 1016 |
| 1016 *pError = nssCKFWObject_verifyPointer(fwObject); | 1017 *pError = nssCKFWObject_verifyPointer(fwObject); |
| 1017 if( CKR_OK != *pError ) { | 1018 if( CKR_OK != *pError ) { |
| 1018 return (CK_ULONG)0; | 1019 return (CK_ULONG)0; |
| 1019 } | 1020 } |
| 1020 #endif /* DEBUG */ | 1021 #endif /* DEBUG */ |
| 1021 | 1022 |
| 1022 return nssCKFWObject_GetObjectSize(fwObject, pError); | 1023 return nssCKFWObject_GetObjectSize(fwObject, pError); |
| 1023 } | 1024 } |
| OLD | NEW |