summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authormatthew <matthew@openbsd.org>2014-04-16 01:35:37 +0000
committermatthew <matthew@openbsd.org>2014-04-16 01:35:37 +0000
commit0194f897d0aa77c030ace1ad81feef57fb556571 (patch)
treeced3f53b3490baf45248a7a33255704ae2f8a915 /lib/libssl/src
parentset ourselves up to respect the max data transfer size. (diff)
downloadwireguard-openbsd-0194f897d0aa77c030ace1ad81feef57fb556571.tar.xz
wireguard-openbsd-0194f897d0aa77c030ace1ad81feef57fb556571.zip
Remove disabled code that wouldn't work now that cleanse_ptr was
removed. Also, fix some nearby KNF nits that were bothering me. ok beck
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/mem.c53
1 files changed, 18 insertions, 35 deletions
diff --git a/lib/libssl/src/crypto/mem.c b/lib/libssl/src/crypto/mem.c
index 86e5ff1c8e6..548c248785f 100644
--- a/lib/libssl/src/crypto/mem.c
+++ b/lib/libssl/src/crypto/mem.c
@@ -180,7 +180,8 @@ CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*f)(void *))
return 1;
}
-int CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t, const char *, int),
+int
+CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t, const char *, int),
void (*f)(void *))
{
if (!allow_customize)
@@ -222,7 +223,8 @@ CRYPTO_get_mem_functions(void *(**m)(size_t), void *(**r)(void *, size_t),
*f = free_func;
}
-void CRYPTO_get_mem_ex_functions(void *(**m)(size_t, const char *, int),
+void
+CRYPTO_get_mem_ex_functions(void *(**m)(size_t, const char *, int),
void *(**r)(void *, size_t, const char *, int), void (**f)(void *))
{
if (m != NULL)
@@ -244,7 +246,8 @@ CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *))
*f = free_locked_func;
}
-void CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t, const char *, int),
+void
+CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t, const char *, int),
void (**f)(void *))
{
if (m != NULL)
@@ -272,8 +275,8 @@ CRYPTO_get_mem_debug_functions(void (**m)(void *, int, const char *, int, int),
}
-void
-*CRYPTO_malloc_locked(int num, const char *file, int line)
+void *
+CRYPTO_malloc_locked(int num, const char *file, int line)
{
void *ret = NULL;
@@ -292,16 +295,6 @@ void
if (malloc_debug_func != NULL)
malloc_debug_func(ret, num, file, line, 1);
-#ifndef OPENSSL_CPUID_OBJ
- /* Create a dependency on the value of 'cleanse_ctr' so our memory
- * sanitisation function can't be optimised out. NB: We only do
- * this for >2Kb so the overhead doesn't bother us. */
- if (ret && (num > 2048)) {
- extern unsigned char cleanse_ctr;
- ((unsigned char *)ret)[0] = cleanse_ctr;
- }
-#endif
-
return ret;
}
@@ -318,8 +311,8 @@ CRYPTO_free_locked(void *str)
free_debug_func(NULL, 1);
}
-void
-*CRYPTO_malloc(int num, const char *file, int line)
+void *
+CRYPTO_malloc(int num, const char *file, int line)
{
void *ret = NULL;
@@ -338,21 +331,11 @@ void
if (malloc_debug_func != NULL)
malloc_debug_func(ret, num, file, line, 1);
-#ifndef OPENSSL_CPUID_OBJ
- /* Create a dependency on the value of 'cleanse_ctr' so our memory
- * sanitisation function can't be optimised out. NB: We only do
- * this for >2Kb so the overhead doesn't bother us. */
- if (ret && (num > 2048)) {
- extern unsigned char cleanse_ctr;
- ((unsigned char *)ret)[0] = cleanse_ctr;
- }
-#endif
-
return ret;
}
-char
-*CRYPTO_strdup(const char *str, const char *file, int line)
+char *
+CRYPTO_strdup(const char *str, const char *file, int line)
{
size_t len = strlen(str) + 1;
char *ret = CRYPTO_malloc(len, file, line);
@@ -361,8 +344,8 @@ char
return ret;
}
-void
-*CRYPTO_realloc(void *str, int num, const char *file, int line)
+void *
+CRYPTO_realloc(void *str, int num, const char *file, int line)
{
void *ret = NULL;
@@ -384,8 +367,8 @@ void
return ret;
}
-void
-*CRYPTO_realloc_clean(void *str, int old_len, int num, const char *file,
+void *
+CRYPTO_realloc_clean(void *str, int old_len, int num, const char *file,
int line)
{
void *ret = NULL;
@@ -433,8 +416,8 @@ CRYPTO_free(void *str)
free_debug_func(NULL, 1);
}
-void
-*CRYPTO_remalloc(void *a, int num, const char *file, int line)
+void *
+CRYPTO_remalloc(void *a, int num, const char *file, int line)
{
if (a != NULL)
OPENSSL_free(a);