summaryrefslogtreecommitdiffstats
path: root/security/nss/lib/freebl/stubs.c
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-28 07:38:20 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-28 07:38:20 +0200
commit6b2bba06b433fb75979ab6daf7bbe8bc76c53875 (patch)
tree75803b4683889e6e0d2a3faef30415db3ff7b3ba /security/nss/lib/freebl/stubs.c
parent72def35cd0cf3649b6d7ab72b66117df3e1c33fc (diff)
parentc75dae3ed21bfa5a8ae46cd83d18329af5bea05a (diff)
downloadUXP-6b2bba06b433fb75979ab6daf7bbe8bc76c53875.tar
UXP-6b2bba06b433fb75979ab6daf7bbe8bc76c53875.tar.gz
UXP-6b2bba06b433fb75979ab6daf7bbe8bc76c53875.tar.lz
UXP-6b2bba06b433fb75979ab6daf7bbe8bc76c53875.tar.xz
UXP-6b2bba06b433fb75979ab6daf7bbe8bc76c53875.zip
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into pm_url_1
Diffstat (limited to 'security/nss/lib/freebl/stubs.c')
-rw-r--r--security/nss/lib/freebl/stubs.c67
1 files changed, 0 insertions, 67 deletions
diff --git a/security/nss/lib/freebl/stubs.c b/security/nss/lib/freebl/stubs.c
index 4d41ef975..8e0784935 100644
--- a/security/nss/lib/freebl/stubs.c
+++ b/security/nss/lib/freebl/stubs.c
@@ -38,11 +38,6 @@
#include <blapi.h>
#include <private/pprio.h>
-/* Android API < 21 doesn't define RTLD_NOLOAD */
-#ifndef RTLD_NOLOAD
-#define RTLD_NOLOAD 0
-#endif
-
#define FREEBL_NO_WEAK 1
#define WEAK __attribute__((weak))
@@ -141,11 +136,6 @@ STUB_DECLARE(int, PORT_GetError_Util, (void));
STUB_DECLARE(PLArenaPool *, PORT_NewArena_Util, (unsigned long chunksize));
STUB_DECLARE(void, PORT_SetError_Util, (int value));
STUB_DECLARE(void *, PORT_ZAlloc_Util, (size_t len));
-STUB_DECLARE(void *, PORT_ZAllocAligned_Util, (size_t bytes, size_t alignment,
- void **mem));
-STUB_DECLARE(void *, PORT_ZAllocAlignedOffset_Util, (size_t bytes,
- size_t alignment,
- size_t offset));
STUB_DECLARE(void, PORT_ZFree_Util, (void *ptr, size_t len));
STUB_DECLARE(void, PR_Assert, (const char *s, const char *file, PRIntn ln));
@@ -184,14 +174,11 @@ STUB_DECLARE(void, SECITEM_FreeItem_Util, (SECItem * zap, PRBool freeit));
STUB_DECLARE(void, SECITEM_ZfreeItem_Util, (SECItem * zap, PRBool freeit));
STUB_DECLARE(SECOidTag, SECOID_FindOIDTag_Util, (const SECItem *oid));
STUB_DECLARE(int, NSS_SecureMemcmp, (const void *a, const void *b, size_t n));
-STUB_DECLARE(unsigned int, NSS_SecureMemcmpZero, (const void *mem, size_t n));
#define PORT_ZNew_stub(type) (type *)PORT_ZAlloc_stub(sizeof(type))
#define PORT_New_stub(type) (type *)PORT_Alloc_stub(sizeof(type))
#define PORT_ZNewArray_stub(type, num) \
(type *)PORT_ZAlloc_stub(sizeof(type) * (num))
-#define PORT_ZNewAligned_stub(type, alignment, mem) \
- (type *)PORT_ZAllocAlignedOffset_stub(sizeof(type), alignment, offsetof(type, mem))
/*
* NOTE: in order to support hashing only the memory allocation stubs,
@@ -227,52 +214,6 @@ PORT_ZAlloc_stub(size_t len)
return ptr;
}
-/* aligned_alloc is C11. This is an alternative to get aligned memory. */
-extern void *
-PORT_ZAllocAligned_stub(size_t bytes, size_t alignment, void **mem)
-{
- STUB_SAFE_CALL3(PORT_ZAllocAligned_Util, bytes, alignment, mem);
-
- /* This only works if alignement is a power of 2. */
- if ((alignment == 0) || (alignment & (alignment - 1))) {
- return NULL;
- }
-
- size_t x = alignment - 1;
- size_t len = (bytes ? bytes : 1) + x;
-
- if (!mem) {
- return NULL;
- }
-
- /* Always allocate a non-zero amount of bytes */
- *mem = malloc(len);
- if (!*mem) {
- return NULL;
- }
-
- memset(*mem, 0, len);
- return (void *)(((uintptr_t)*mem + x) & ~(uintptr_t)x);
-}
-
-extern void *
-PORT_ZAllocAlignedOffset_stub(size_t size, size_t alignment, size_t offset)
-{
- STUB_SAFE_CALL3(PORT_ZAllocAlignedOffset_Util, size, alignment, offset);
- if (offset > size) {
- return NULL;
- }
-
- void *mem = NULL;
- void *v = PORT_ZAllocAligned_stub(size, alignment, &mem);
- if (!v) {
- return NULL;
- }
-
- *((void **)((uintptr_t)v + offset)) = mem;
- return v;
-}
-
extern void
PORT_ZFree_stub(void *ptr, size_t len)
{
@@ -649,13 +590,6 @@ NSS_SecureMemcmp_stub(const void *a, const void *b, size_t n)
abort();
}
-extern unsigned int
-NSS_SecureMemcmpZero_stub(const void *mem, size_t n)
-{
- STUB_SAFE_CALL2(NSS_SecureMemcmpZero, mem, n);
- abort();
-}
-
#ifdef FREEBL_NO_WEAK
static const char *nsprLibName = SHLIB_PREFIX "nspr4." SHLIB_SUFFIX;
@@ -708,7 +642,6 @@ freebl_InitNSSUtil(void *lib)
STUB_FETCH_FUNCTION(SECITEM_ZfreeItem_Util);
STUB_FETCH_FUNCTION(SECOID_FindOIDTag_Util);
STUB_FETCH_FUNCTION(NSS_SecureMemcmp);
- STUB_FETCH_FUNCTION(NSS_SecureMemcmpZero);
return SECSuccess;
}