| 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 #ifndef BUILTINS_H | 5 #ifndef BUILTINS_H |
| 6 #include "builtins.h" | 6 #include "builtins.h" |
| 7 #endif /* BUILTINS_H */ | 7 #endif /* BUILTINS_H */ |
| 8 | 8 |
| 9 /* | 9 /* |
| 10 * builtins/find.c | 10 * builtins/find.c |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 CK_ATTRIBUTE_PTR a, | 108 CK_ATTRIBUTE_PTR a, |
| 109 const NSSItem *b | 109 const NSSItem *b |
| 110 ) | 110 ) |
| 111 { | 111 { |
| 112 PRBool prb; | 112 PRBool prb; |
| 113 | 113 |
| 114 if( a->ulValueLen != b->size ) { | 114 if( a->ulValueLen != b->size ) { |
| 115 /* match a decoded serial number */ | 115 /* match a decoded serial number */ |
| 116 if ((a->type == CKA_SERIAL_NUMBER) && (a->ulValueLen < b->size)) { | 116 if ((a->type == CKA_SERIAL_NUMBER) && (a->ulValueLen < b->size)) { |
| 117 int len; | 117 int len; |
| 118 » unsigned char *data; | 118 » unsigned char *data = NULL; |
| 119 | 119 |
| 120 len = builtins_derUnwrapInt(b->data,b->size,&data); | 120 len = builtins_derUnwrapInt(b->data,b->size,&data); |
| 121 » if ((len == a->ulValueLen) && | 121 » if (data && |
| 122 » » nsslibc_memequal(a->pValue, data, len, (PRStatus *)NULL)) { | 122 » (len == a->ulValueLen) && |
| 123 » nsslibc_memequal(a->pValue, data, len, (PRStatus *)NULL)) { |
| 123 return CK_TRUE; | 124 return CK_TRUE; |
| 124 } | 125 } |
| 125 } | 126 } |
| 126 return CK_FALSE; | 127 return CK_FALSE; |
| 127 } | 128 } |
| 128 | 129 |
| 129 prb = nsslibc_memequal(a->pValue, b->data, b->size, (PRStatus *)NULL); | 130 prb = nsslibc_memequal(a->pValue, b->data, b->size, (PRStatus *)NULL); |
| 130 | 131 |
| 131 if( PR_TRUE == prb ) { | 132 if( PR_TRUE == prb ) { |
| 132 return CK_TRUE; | 133 return CK_TRUE; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 loser: | 242 loser: |
| 242 nss_ZFreeIf(temp); | 243 nss_ZFreeIf(temp); |
| 243 nss_ZFreeIf(fo); | 244 nss_ZFreeIf(fo); |
| 244 nss_ZFreeIf(rv); | 245 nss_ZFreeIf(rv); |
| 245 if ((NSSArena *)NULL != arena) { | 246 if ((NSSArena *)NULL != arena) { |
| 246 NSSArena_Destroy(arena); | 247 NSSArena_Destroy(arena); |
| 247 } | 248 } |
| 248 return (NSSCKMDFindObjects *)NULL; | 249 return (NSSCKMDFindObjects *)NULL; |
| 249 } | 250 } |
| 250 | 251 |
| OLD | NEW |