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 * secport.c - portability interfaces for security libraries | 6 * secport.c - portability interfaces for security libraries |
7 * | 7 * |
8 * This file abstracts out libc functionality that libsec depends on | 8 * This file abstracts out libc functionality that libsec depends on |
9 * | 9 * |
10 * NOTE - These are not public interfaces | 10 * NOTE - These are not public interfaces |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 | 314 |
315 if (!pool) | 315 if (!pool) |
316 return; | 316 return; |
317 if (ARENAPOOL_MAGIC == pool->magic ) { | 317 if (ARENAPOOL_MAGIC == pool->magic ) { |
318 len = sizeof *pool; | 318 len = sizeof *pool; |
319 lock = pool->lock; | 319 lock = pool->lock; |
320 PZ_Lock(lock); | 320 PZ_Lock(lock); |
321 } | 321 } |
322 if (!checkedEnv) { | 322 if (!checkedEnv) { |
323 /* no need for thread protection here */ | 323 /* no need for thread protection here */ |
324 » doFreeArenaPool = (PR_GetEnv("NSS_DISABLE_ARENA_FREE_LIST") == NULL); | 324 » doFreeArenaPool = (PR_GetEnvSecure("NSS_DISABLE_ARENA_FREE_LIST") == NUL
L); |
325 checkedEnv = PR_TRUE; | 325 checkedEnv = PR_TRUE; |
326 } | 326 } |
327 if (zero) { | 327 if (zero) { |
328 PL_ClearArenaPool(arena, 0); | 328 PL_ClearArenaPool(arena, 0); |
329 } | 329 } |
330 if (doFreeArenaPool) { | 330 if (doFreeArenaPool) { |
331 PL_FreeArenaPool(arena); | 331 PL_FreeArenaPool(arena); |
332 } else { | 332 } else { |
333 PL_FinishArenaPool(arena); | 333 PL_FinishArenaPool(arena); |
334 } | 334 } |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 const unsigned char *b = (const unsigned char*) ib; | 707 const unsigned char *b = (const unsigned char*) ib; |
708 size_t i; | 708 size_t i; |
709 unsigned char r = 0; | 709 unsigned char r = 0; |
710 | 710 |
711 for (i = 0; i < n; ++i) { | 711 for (i = 0; i < n; ++i) { |
712 r |= *a++ ^ *b++; | 712 r |= *a++ ^ *b++; |
713 } | 713 } |
714 | 714 |
715 return r; | 715 return r; |
716 } | 716 } |
OLD | NEW |