summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2015-12-16 16:12:24 -0500
committerRich Salz <rsalz@openssl.org>2015-12-16 16:14:49 -0500
commit7644a9aef8932ed4d1c3f25ed776c997702982be (patch)
treed8f1e7fca20ad12683a1e2e52c92b6999ada23a6 /crypto
parente4cf866322a4549c55153f9f135f9dadf4d3fc31 (diff)
Rename some BUF_xxx to OPENSSL_xxx
Rename BUF_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} to OPENSSL_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} Add #define's for the old names. Add CRYPTO_{memdup,strndup}, called by OPENSSL_{memdup,strndup} macros. Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/Makefile9
-rw-r--r--crypto/asn1/a_time.c6
-rw-r--r--crypto/asn1/ameth_lib.c4
-rw-r--r--crypto/asn1/asn_mime.c8
-rw-r--r--crypto/bio/b_dump.c14
-rw-r--r--crypto/bio/b_sock.c2
-rw-r--r--crypto/bio/bss_acpt.c2
-rw-r--r--crypto/bio/bss_conn.c10
-rw-r--r--crypto/bio/bss_file.c10
-rw-r--r--crypto/buffer/Makefile12
-rw-r--r--crypto/buffer/buf_err.c3
-rw-r--r--crypto/buffer/buf_str.c137
-rw-r--r--crypto/conf/conf_def.c4
-rw-r--r--crypto/conf/conf_mod.c14
-rw-r--r--crypto/cpt_err.c1
-rw-r--r--crypto/dh/dh_ameth.c6
-rw-r--r--crypto/dh/dh_pmeth.c2
-rw-r--r--crypto/dso/dso_lib.c4
-rw-r--r--crypto/ec/ec_pmeth.c2
-rw-r--r--crypto/engine/eng_dyn.c6
-rw-r--r--crypto/err/err.c2
-rw-r--r--crypto/evp/e_chacha20_poly1305.c2
-rw-r--r--crypto/evp/evp_pbe.c2
-rw-r--r--crypto/lock.c2
-rw-r--r--crypto/mem.c9
-rw-r--r--crypto/mem_dbg.c2
-rw-r--r--crypto/o_str.c81
-rw-r--r--crypto/objects/obj_dat.c6
-rw-r--r--crypto/ocsp/ocsp_lib.c10
-rw-r--r--crypto/pem/pem_lib.c12
-rw-r--r--crypto/rand/Makefile6
-rw-r--r--crypto/rand/rand_egd.c4
-rw-r--r--crypto/rand/randfile.c12
-rw-r--r--crypto/rsa/rsa_pmeth.c2
-rw-r--r--crypto/srp/srp_vfy.c10
-rw-r--r--crypto/store/str_lib.c4
-rw-r--r--crypto/store/str_meth.c2
-rw-r--r--crypto/ui/ui_lib.c30
-rw-r--r--crypto/x509/x509_trs.c2
-rw-r--r--crypto/x509/x509_vpm.c8
-rw-r--r--crypto/x509v3/v3_addr.c6
-rw-r--r--crypto/x509v3/v3_asid.c2
-rw-r--r--crypto/x509v3/v3_enum.c2
-rw-r--r--crypto/x509v3/v3_info.c6
-rw-r--r--crypto/x509v3/v3_purp.c4
-rw-r--r--crypto/x509v3/v3_utl.c14
46 files changed, 215 insertions, 283 deletions
diff --git a/crypto/Makefile b/crypto/Makefile
index b2cf528a91..43cb71f008 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -202,8 +202,13 @@ o_init.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
o_init.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
o_init.o: ../include/openssl/safestack.h ../include/openssl/stack.h
o_init.o: ../include/openssl/symhacks.h o_init.c
-o_str.o: ../e_os.h ../include/internal/o_str.h ../include/openssl/e_os2.h
-o_str.o: ../include/openssl/opensslconf.h o_str.c
+o_str.o: ../e_os.h ../include/internal/o_str.h ../include/openssl/bio.h
+o_str.o: ../include/openssl/buffer.h ../include/openssl/crypto.h
+o_str.o: ../include/openssl/e_os2.h ../include/openssl/err.h
+o_str.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
+o_str.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
+o_str.o: ../include/openssl/safestack.h ../include/openssl/stack.h
+o_str.o: ../include/openssl/symhacks.h include/internal/cryptlib.h o_str.c
o_time.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
o_time.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
o_time.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c
index ff82beb3ee..c5e632e356 100644
--- a/crypto/asn1/a_time.c
+++ b/crypto/asn1/a_time.c
@@ -139,11 +139,11 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t,
str = (char *)ret->data;
/* Work out the century and prepend */
if (t->data[0] >= '5')
- BUF_strlcpy(str, "19", newlen);
+ OPENSSL_strlcpy(str, "19", newlen);
else
- BUF_strlcpy(str, "20", newlen);
+ OPENSSL_strlcpy(str, "20", newlen);
- BUF_strlcat(str, (char *)t->data, newlen);
+ OPENSSL_strlcat(str, (char *)t->data, newlen);
return ret;
}
diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c
index 05f0a80da8..85115bc5b7 100644
--- a/crypto/asn1/ameth_lib.c
+++ b/crypto/asn1/ameth_lib.c
@@ -285,13 +285,13 @@ EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags,
ameth->pkey_flags = flags | ASN1_PKEY_DYNAMIC;
if (info) {
- ameth->info = BUF_strdup(info);
+ ameth->info = OPENSSL_strdup(info);
if (!ameth->info)
goto err;
}
if (pem_str) {
- ameth->pem_str = BUF_strdup(pem_str);
+ ameth->pem_str = OPENSSL_strdup(pem_str);
if (!ameth->pem_str)
goto err;
}
diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c
index 53690999b4..ed9d8d68b7 100644
--- a/crypto/asn1/asn_mime.c
+++ b/crypto/asn1/asn_mime.c
@@ -829,7 +829,7 @@ static MIME_HEADER *mime_hdr_new(char *name, char *value)
int c;
if (name) {
- if ((tmpname = BUF_strdup(name)) == NULL)
+ if ((tmpname = OPENSSL_strdup(name)) == NULL)
return NULL;
for (p = tmpname; *p; p++) {
c = (unsigned char)*p;
@@ -840,7 +840,7 @@ static MIME_HEADER *mime_hdr_new(char *name, char *value)
}
}
if (value) {
- if ((tmpval = BUF_strdup(value)) == NULL)
+ if ((tmpval = OPENSSL_strdup(value)) == NULL)
goto err;
for (p = tmpval; *p; p++) {
c = (unsigned char)*p;
@@ -872,7 +872,7 @@ static int mime_hdr_addparam(MIME_HEADER *mhdr, char *name, char *value)
int c;
MIME_PARAM *mparam = NULL;
if (name) {
- tmpname = BUF_strdup(name);
+ tmpname = OPENSSL_strdup(name);
if (!tmpname)
goto err;
for (p = tmpname; *p; p++) {
@@ -884,7 +884,7 @@ static int mime_hdr_addparam(MIME_HEADER *mhdr, char *name, char *value)
}
}
if (value) {
- tmpval = BUF_strdup(value);
+ tmpval = OPENSSL_strdup(value);
if (!tmpval)
goto err;
}
diff --git a/crypto/bio/b_dump.c b/crypto/bio/b_dump.c
index 55792b9e30..3d005e3ff9 100644
--- a/crypto/bio/b_dump.c
+++ b/crypto/bio/b_dump.c
@@ -104,20 +104,20 @@ int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
if ((rows * dump_width) < len)
rows++;
for (i = 0; i < rows; i++) {
- BUF_strlcpy(buf, str, sizeof buf);
+ OPENSSL_strlcpy(buf, str, sizeof buf);
BIO_snprintf(tmp, sizeof tmp, "%04x - ", i * dump_width);
- BUF_strlcat(buf, tmp, sizeof buf);
+ OPENSSL_strlcat(buf, tmp, sizeof buf);
for (j = 0; j < dump_width; j++) {
if (((i * dump_width) + j) >= len) {
- BUF_strlcat(buf, " ", sizeof buf);
+ OPENSSL_strlcat(buf, " ", sizeof buf);
} else {
ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
BIO_snprintf(tmp, sizeof tmp, "%02x%c", ch,
j == 7 ? '-' : ' ');
- BUF_strlcat(buf, tmp, sizeof buf);
+ OPENSSL_strlcat(buf, tmp, sizeof buf);
}
}
- BUF_strlcat(buf, " ", sizeof buf);
+ OPENSSL_strlcat(buf, " ", sizeof buf);
for (j = 0; j < dump_width; j++) {
if (((i * dump_width) + j) >= len)
break;
@@ -131,9 +131,9 @@ int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
? os_toebcdic[ch]
: '.');
#endif
- BUF_strlcat(buf, tmp, sizeof buf);
+ OPENSSL_strlcat(buf, tmp, sizeof buf);
}
- BUF_strlcat(buf, "\n", sizeof buf);
+ OPENSSL_strlcat(buf, "\n", sizeof buf);
/*
* if this is the last call then update the ddt_dump thing so that we
* will move the selection point in the debug window
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c
index e536eda2a6..cc090724e8 100644
--- a/crypto/bio/b_sock.c
+++ b/crypto/bio/b_sock.c
@@ -402,7 +402,7 @@ int BIO_get_accept_socket(char *host, int bind_mode)
if (BIO_sock_init() != 1)
return ((int)INVALID_SOCKET);
- if ((str = BUF_strdup(host)) == NULL)
+ if ((str = OPENSSL_strdup(host)) == NULL)
return ((int)INVALID_SOCKET);
h = p = NULL;
diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c
index c549c87c3c..f65ee1a6ef 100644
--- a/crypto/bio/bss_acpt.c
+++ b/crypto/bio/bss_acpt.c
@@ -350,7 +350,7 @@ static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr)
if (num == 0) {
b->init = 1;
OPENSSL_free(data->param_addr);
- data->param_addr = BUF_strdup(ptr);
+ data->param_addr = OPENSSL_strdup(ptr);
} else if (num == 1) {
data->accept_nbio = (ptr != NULL);
} else if (num == 2) {
diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c
index ba009aa6b0..929656c882 100644
--- a/crypto/bio/bss_conn.c
+++ b/crypto/bio/bss_conn.c
@@ -149,7 +149,7 @@ static int conn_state(BIO *b, BIO_CONNECT *c)
break;
}
OPENSSL_free(c->param_port);
- c->param_port = BUF_strdup(p);
+ c->param_port = OPENSSL_strdup(p);
}
}
@@ -455,10 +455,10 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
b->init = 1;
if (num == 0) {
OPENSSL_free(data->param_hostname);
- data->param_hostname = BUF_strdup(ptr);
+ data->param_hostname = OPENSSL_strdup(ptr);
} else if (num == 1) {
OPENSSL_free(data->param_port);
- data->param_port = BUF_strdup(ptr);
+ data->param_port = OPENSSL_strdup(ptr);
} else if (num == 2) {
char buf[16];
unsigned char *p = ptr;
@@ -466,14 +466,14 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr)
BIO_snprintf(buf, sizeof buf, "%d.%d.%d.%d",
p[0], p[1], p[2], p[3]);
OPENSSL_free(data->param_hostname);
- data->param_hostname = BUF_strdup(buf);
+ data->param_hostname = OPENSSL_strdup(buf);
memcpy(&(data->ip[0]), ptr, 4);
} else if (num == 3) {
char buf[DECIMAL_SIZE(int) + 1];
BIO_snprintf(buf, sizeof buf, "%d", *(int *)ptr);
OPENSSL_free(data->param_port);
- data->param_port = BUF_strdup(buf);
+ data->param_port = OPENSSL_strdup(buf);
data->port = *(int *)ptr;
}
}
diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c
index 7692ee293c..c09a9a95f6 100644
--- a/crypto/bio/bss_file.c
+++ b/crypto/bio/bss_file.c
@@ -367,15 +367,15 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr)
b->shutdown = (int)num & BIO_CLOSE;
if (num & BIO_FP_APPEND) {
if (num & BIO_FP_READ)
- BUF_strlcpy(p, "a+", sizeof p);
+ OPENSSL_strlcpy(p, "a+", sizeof p);
else
- BUF_strlcpy(p, "a", sizeof p);
+ OPENSSL_strlcpy(p, "a", sizeof p);
} else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE))
- BUF_strlcpy(p, "r+", sizeof p);
+ OPENSSL_strlcpy(p, "r+", sizeof p);
else if (num & BIO_FP_WRITE)
- BUF_strlcpy(p, "w", sizeof p);
+ OPENSSL_strlcpy(p, "w", sizeof p);
else if (num & BIO_FP_READ)
- BUF_strlcpy(p, "r", sizeof p);
+ OPENSSL_strlcpy(p, "r", sizeof p);
else {
BIOerr(BIO_F_FILE_CTRL, BIO_R_BAD_FOPEN_MODE);
ret = 0;
diff --git a/crypto/buffer/Makefile b/crypto/buffer/Makefile
index f9d52febb5..e0b6ffd324 100644
--- a/crypto/buffer/Makefile
+++ b/crypto/buffer/Makefile
@@ -15,8 +15,8 @@ CFLAGS= $(INCLUDES) $(CFLAG)
GENERAL=Makefile
LIB=$(TOP)/libcrypto.a
-LIBSRC= buffer.c buf_str.c buf_err.c
-LIBOBJ= buffer.o buf_str.o buf_err.o
+LIBSRC= buffer.c buf_err.c
+LIBOBJ= buffer.o buf_err.o
SRC= $(LIBSRC)
@@ -67,14 +67,6 @@ buf_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
buf_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
buf_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
buf_err.o: buf_err.c
-buf_str.o: ../../e_os.h ../../include/openssl/bio.h
-buf_str.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
-buf_str.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
-buf_str.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
-buf_str.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
-buf_str.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
-buf_str.o: ../../include/openssl/symhacks.h ../include/internal/cryptlib.h
-buf_str.o: buf_str.c
buffer.o: ../../e_os.h ../../include/openssl/bio.h
buffer.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
buffer.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
diff --git a/crypto/buffer/buf_err.c b/crypto/buffer/buf_err.c
index 34671aa8ba..e126edd6f1 100644
--- a/crypto/buffer/buf_err.c
+++ b/crypto/buffer/buf_err.c
@@ -70,12 +70,9 @@
# define ERR_REASON(reason) ERR_PACK(ERR_LIB_BUF,0,reason)
static ERR_STRING_DATA BUF_str_functs[] = {
- {ERR_FUNC(BUF_F_BUF_MEMDUP), "BUF_memdup"},
{ERR_FUNC(BUF_F_BUF_MEM_GROW), "BUF_MEM_grow"},
{ERR_FUNC(BUF_F_BUF_MEM_GROW_CLEAN), "BUF_MEM_grow_clean"},
{ERR_FUNC(BUF_F_BUF_MEM_NEW), "BUF_MEM_new"},
- {ERR_FUNC(BUF_F_BUF_STRDUP), "BUF_strdup"},
- {ERR_FUNC(BUF_F_BUF_STRNDUP), "BUF_strndup"},
{0, NULL}
};
diff --git a/crypto/buffer/buf_str.c b/crypto/buffer/buf_str.c
deleted file mode 100644
index 1f3e8a4e79..0000000000
--- a/crypto/buffer/buf_str.c
+++ /dev/null
@@ -1,137 +0,0 @@
-/* crypto/buffer/buffer.c */
-/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
- * All rights reserved.
- *
- * This package is an SSL implementation written
- * by Eric Young (eay@cryptsoft.com).
- * The implementation was written so as to conform with Netscapes SSL.
- *
- * This library is free for commercial and non-commercial use as long as
- * the following conditions are aheared to. The following conditions
- * apply to all code found in this distribution, be it the RC4, RSA,
- * lhash, DES, etc., code; not just the SSL code. The SSL documentation
- * included with this distribution is covered by the same copyright terms
- * except that the holder is Tim Hudson (tjh@cryptsoft.com).
- *
- * Copyright remains Eric Young's, and as such any Copyright notices in
- * the code are not to be removed.
- * If this package is used in a product, Eric Young should be given attribution
- * as the author of the parts of the library used.
- * This can be in the form of a textual message at program startup or
- * in documentation (online or textual) provided with the package.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * "This product includes cryptographic software written by
- * Eric Young (eay@cryptsoft.com)"
- * The word 'cryptographic' can be left out if the rouines from the library
- * being used are not cryptographic related :-).
- * 4. If you include any Windows specific code (or a derivative thereof) from
- * the apps directory (application code) you must include an acknowledgement:
- * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
- *
- * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * The licence and distribution terms for any publically available version or
- * derivative of this code cannot be changed. i.e. this code cannot simply be
- * copied and put under another distribution licence
- * [including the GNU Public Licence.]
- */
-
-#include <stdio.h>
-#include <limits.h>
-#include "internal/cryptlib.h"
-#include <openssl/buffer.h>
-
-size_t BUF_strnlen(const char *str, size_t maxlen)
-{
- const char *p;
-
- for (p = str; maxlen-- != 0 && *p != '\0'; ++p) ;
-
- return p - str;
-}
-
-char *BUF_strdup(const char *str)
-{
- if (str == NULL)
- return NULL;
- return BUF_strndup(str, strlen(str));
-}
-
-char *BUF_strndup(const char *str, size_t siz)
-{
- char *ret;
-
- if (str == NULL)
- return NULL;
-
- siz = BUF_strnlen(str, siz);
-
- if (siz >= INT_MAX)
- return NULL;
-
- ret = OPENSSL_malloc(siz + 1);
- if (ret == NULL) {
- BUFerr(BUF_F_BUF_STRNDUP, ERR_R_MALLOC_FAILURE);
- return NULL;
- }
-
- memcpy(ret, str, siz);
- ret[siz] = '\0';
-
- return (ret);
-}
-
-void *BUF_memdup(const void *data, size_t siz)
-{
- void *ret;
-
- if (data == NULL || siz >= INT_MAX)
- return NULL;
-
- ret = OPENSSL_malloc(siz);
- if (ret == NULL) {
- BUFerr(BUF_F_BUF_MEMDUP, ERR_R_MALLOC_FAILURE);
- return NULL;
- }
- return memcpy(ret, data, siz);
-}
-
-size_t BUF_strlcpy(char *dst, const char *src, size_t size)
-{
- size_t l = 0;
- for (; size > 1 && *src; size--) {
- *dst++ = *src++;
- l++;
- }
- if (size)
- *dst = '\0';
- return l + strlen(src);
-}
-
-size_t BUF_strlcat(char *dst, const char *src, size_t size)
-{
- size_t l = 0;
- for (; size > 0 && *dst; size--, dst++)
- l++;
- return l + BUF_strlcpy(dst, src, size);
-}
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c
index 1ff49aa281..ac074056d1 100644
--- a/crypto/conf/conf_def.c
+++ b/crypto/conf/conf_def.c
@@ -223,7 +223,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
goto err;
}
- section = BUF_strdup("default");
+ section = OPENSSL_strdup("default");
if (section == NULL) {
CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
goto err;
@@ -366,7 +366,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
goto err;
}
- BUF_strlcpy(v->name, pname, strlen(pname) + 1);
+ OPENSSL_strlcpy(v->name, pname, strlen(pname) + 1);
if (!str_copy(conf, psection, &(v->value), start))
goto err;
diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c
index c1fbb601d5..4fafdeddd3 100644
--- a/crypto/conf/conf_mod.c
+++ b/crypto/conf/conf_mod.c
@@ -286,7 +286,7 @@ static CONF_MODULE *module_add(DSO *dso, const char *name,
return NULL;
tmod->dso = dso;
- tmod->name = BUF_strdup(name);
+ tmod->name = OPENSSL_strdup(name);
tmod->init = ifunc;
tmod->finish = ffunc;
@@ -340,8 +340,8 @@ static int module_init(CONF_MODULE *pmod, char *name, char *value,
goto err;
imod->pmod = pmod;
- imod->name = BUF_strdup(name);
- imod->value = BUF_strdup(value);
+ imod->name = OPENSSL_strdup(name);
+ imod->value = OPENSSL_strdup(value);
imod->usr_data = NULL;
if (!imod->name || !imod->value)
@@ -525,7 +525,7 @@ char *CONF_get1_default_config_file(void)
file = getenv("OPENSSL_CONF");
if (file)
- return BUF_strdup(file);
+ return OPENSSL_strdup(file);
len = strlen(X509_get_default_cert_area());
#ifndef OPENSSL_SYS_VMS
@@ -537,11 +537,11 @@ char *CONF_get1_default_config_file(void)
if (file == NULL)
return NULL;
- BUF_strlcpy(file, X509_get_default_cert_area(), len + 1);
+ OPENSSL_strlcpy(file, X509_get_default_cert_area(), len + 1);
#ifndef OPENSSL_SYS_VMS
- BUF_strlcat(file, "/", len + 1);
+ OPENSSL_strlcat(file, "/", len + 1);
#endif
- BUF_strlcat(file, OPENSSL_CONF, len + 1);
+ OPENSSL_strlcat(file, OPENSSL_CONF, len + 1);
return file;
}
diff --git a/crypto/cpt_err.c b/crypto/cpt_err.c
index b8d3fa4d7e..af505ac5b1 100644
--- a/crypto/cpt_err.c
+++ b/crypto/cpt_err.c
@@ -75,6 +75,7 @@ static ERR_STRING_DATA CRYPTO_str_functs[] = {
{ERR_FUNC(CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX), "CRYPTO_get_ex_new_index"},
{ERR_FUNC(CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID), "CRYPTO_get_new_dynlockid"},
{ERR_FUNC(CRYPTO_F_CRYPTO_GET_NEW_LOCKID), "CRYPTO_get_new_lockid"},
+ {ERR_FUNC(CRYPTO_F_CRYPTO_MEMDUP), "CRYPTO_memdup"},
{ERR_FUNC(CRYPTO_F_CRYPTO_NEW_EX_DATA), "CRYPTO_new_ex_data"},
{ERR_FUNC(CRYPTO_F_CRYPTO_SET_EX_DATA), "CRYPTO_set_ex_data"},
{ERR_FUNC(CRYPTO_F_DEF_ADD_INDEX), "DEF_ADD_INDEX"},
diff --git a/crypto/dh/dh_ameth.c b/crypto/dh/dh_ameth.c
index 7a3d9235cf..64eaf4ca0a 100644
--- a/crypto/dh/dh_ameth.c
+++ b/crypto/dh/dh_ameth.c
@@ -482,7 +482,7 @@ static int int_dh_param_copy(DH *to, const DH *from, int is_x942)
to->seed = NULL;
to->seedlen = 0;
if (from->seed) {
- to->seed = BUF_memdup(from->seed, from->seedlen);
+ to->seed = OPENSSL_memdup(from->seed, from->seedlen);
if (!to->seed)
return 0;
to->seedlen = from->seedlen;
@@ -770,7 +770,7 @@ static int dh_cms_set_shared_info(EVP_PKEY_CTX *pctx, CMS_RecipientInfo *ri)
if (ukm) {
dukmlen = ASN1_STRING_length(ukm);
- dukm = BUF_memdup(ASN1_STRING_data(ukm), dukmlen);
+ dukm = OPENSSL_memdup(ASN1_STRING_data(ukm), dukmlen);
if (!dukm)
goto err;
}
@@ -914,7 +914,7 @@ static int dh_cms_encrypt(CMS_RecipientInfo *ri)
if (ukm) {
dukmlen = ASN1_STRING_length(ukm);
- dukm = BUF_memdup(ASN1_STRING_data(ukm), dukmlen);
+ dukm = OPENSSL_memdup(ASN1_STRING_data(ukm), dukmlen);
if (!dukm)
goto err;
}
diff --git a/crypto/dh/dh_pmeth.c b/crypto/dh/dh_pmeth.c
index 1e12c3e9a7..a760ff5390 100644
--- a/crypto/dh/dh_pmeth.c
+++ b/crypto/dh/dh_pmeth.c
@@ -134,7 +134,7 @@ static int pkey_dh_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)
return 0;
dctx->kdf_md = sctx->kdf_md;
if (dctx->kdf_ukm) {
- dctx->kdf_ukm = BUF_memdup(sctx->kdf_ukm, sctx->kdf_ukmlen);
+ dctx->kdf_ukm = OPENSSL_memdup(sctx->kdf_ukm, sctx->kdf_ukmlen);
dctx->kdf_ukmlen = sctx->kdf_ukmlen;
}
dctx->kdf_outlen = sctx->kdf_outlen;
diff --git a/crypto/dso/dso_lib.c b/crypto/dso/dso_lib.c
index 17d1732dfc..56e765721c 100644
--- a/crypto/dso/dso_lib.c
+++ b/crypto/dso/dso_lib.c
@@ -353,7 +353,7 @@ int DSO_set_filename(DSO *dso, const char *filename)
DSOerr(DSO_F_DSO_SET_FILENAME, ERR_R_MALLOC_FAILURE);
return (0);
}
- BUF_strlcpy(copied, filename, strlen(filename) + 1);
+ OPENSSL_strlcpy(copied, filename, strlen(filename) + 1);
OPENSSL_free(dso->filename);
dso->filename = copied;
return (1);
@@ -402,7 +402,7 @@ char *DSO_convert_filename(DSO *dso, const char *filename)
DSOerr(DSO_F_DSO_CONVERT_FILENAME, ERR_R_