summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/enc.c6
-rw-r--r--apps/engine.c4
-rw-r--r--apps/pkcs12.c2
-rw-r--r--apps/req.c36
-rw-r--r--apps/s_time.c13
-rw-r--r--apps/x509.c6
-rw-r--r--crypto/asn1/a_gentm.c6
-rw-r--r--crypto/asn1/a_mbstr.c4
-rw-r--r--crypto/asn1/a_time.c9
-rw-r--r--crypto/asn1/a_utctm.c6
-rw-r--r--crypto/asn1/asn1_par.c8
-rw-r--r--crypto/asn1/x_long.c9
-rw-r--r--crypto/bio/b_dump.c27
-rw-r--r--crypto/bio/bio_cb.c48
-rw-r--r--crypto/bio/bss_file.c10
-rw-r--r--crypto/bn/bn_print.c13
-rw-r--r--crypto/conf/conf_def.c4
-rw-r--r--crypto/conf/conf_mod.c8
-rw-r--r--crypto/cversion.c4
-rw-r--r--crypto/des/ecb_enc.c2
-rw-r--r--crypto/engine/eng_ctrl.c10
-rw-r--r--crypto/evp/evp_pbe.c2
-rw-r--r--crypto/mem_dbg.c23
-rw-r--r--crypto/objects/obj_dat.c2
-rw-r--r--crypto/pem/pem_lib.c14
-rw-r--r--crypto/rand/rand_egd.c2
-rw-r--r--crypto/x509/by_dir.c4
-rw-r--r--crypto/x509v3/v3_alt.c5
-rw-r--r--crypto/x509v3/v3_info.c8
29 files changed, 132 insertions, 163 deletions
diff --git a/apps/enc.c b/apps/enc.c
index d2000752f8..338307330a 100644
--- a/apps/enc.c
+++ b/apps/enc.c
@@ -312,9 +312,9 @@ int enc_main(int argc, char **argv)
for (;;) {
char prompt[200];
- BIO_snprintf(prompt, sizeof prompt, "enter %s %s password:",
- OBJ_nid2ln(EVP_CIPHER_nid(cipher)),
- (enc) ? "encryption" : "decryption");
+ sprintf(prompt, "enter %s %s password:",
+ OBJ_nid2ln(EVP_CIPHER_nid(cipher)),
+ (enc) ? "encryption" : "decryption");
strbuf[0] = '\0';
i = EVP_read_pw_string((char *)strbuf, SIZE, prompt, enc);
if (i == 0) {
diff --git a/apps/engine.c b/apps/engine.c
index 7724084255..61fb758b40 100644
--- a/apps/engine.c
+++ b/apps/engine.c
@@ -67,8 +67,8 @@ static int append_buf(char **buf, int *size, const char *s)
}
if (**buf != '\0')
- OPENSSL_strlcat(*buf, ", ", *size);
- OPENSSL_strlcat(*buf, s, *size);
+ strcat(*buf, ", ");
+ strcat(*buf, s);
return 1;
}
diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index 9449679cea..82d2bb972e 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -455,7 +455,7 @@ int pkcs12_main(int argc, char **argv)
}
if (!twopass)
- OPENSSL_strlcpy(macpass, pass, sizeof macpass);
+ strcpy(macpass, pass);
p12 = PKCS12_create(cpass, name, key, ucert, certs,
key_pbe, cert_pbe, iter, -1, keytype);
diff --git a/apps/req.c b/apps/req.c
index 34d906566c..9b6c48d4c4 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -984,30 +984,30 @@ static int prompt_info(X509_REQ *req,
/* If OBJ not recognised ignore it */
if ((nid = OBJ_txt2nid(type)) == NID_undef)
goto start;
- if (BIO_snprintf(buf, sizeof buf, "%s_default", v->name)
- >= (int)sizeof(buf)) {
+ if (strlen(v->name) + sizeof("_default") > sizeof(buf)) {
BIO_printf(bio_err, "Name '%s' too long\n", v->name);
return 0;
}
+ sprintf(buf, "%s_default", v->name);
if ((def = NCONF_get_string(req_conf, dn_sect, buf)) == NULL) {
ERR_clear_error();
def = "";
}
- BIO_snprintf(buf, sizeof buf, "%s_value", v->name);
+ sprintf(buf, "%s_value", v->name);
if ((value = NCONF_get_string(req_conf, dn_sect, buf)) == NULL) {
ERR_clear_error();
value = NULL;
}
- BIO_snprintf(buf, sizeof buf, "%s_min", v->name);
+ sprintf(buf, "%s_min", v->name);
if (!NCONF_get_number(req_conf, dn_sect, buf, &n_min)) {
ERR_clear_error();
n_min = -1;
}
- BIO_snprintf(buf, sizeof buf, "%s_max", v->name);
+ sprintf(buf, "%s_max", v->name);
if (!NCONF_get_number(req_conf, dn_sect, buf, &n_max)) {
ERR_clear_error();
n_max = -1;
@@ -1044,11 +1044,11 @@ static int prompt_info(X509_REQ *req,
if ((nid = OBJ_txt2nid(type)) == NID_undef)
goto start2;
- if (BIO_snprintf(buf, sizeof buf, "%s_default", type)
- >= (int)sizeof(buf)) {
+ if (strlen(type) + sizeof("_default") > sizeof(buf)) {
BIO_printf(bio_err, "Name '%s' too long\n", v->name);
return 0;
}
+ sprintf(buf, "%s_default", type);
if ((def = NCONF_get_string(req_conf, attr_sect, buf))
== NULL) {
@@ -1056,20 +1056,20 @@ static int prompt_info(X509_REQ *req,
def = "";
}
- BIO_snprintf(buf, sizeof buf, "%s_value", type);
+ sprintf(buf, "%s_value", type);
if ((value = NCONF_get_string(req_conf, attr_sect, buf))
== NULL) {
ERR_clear_error();
value = NULL;
}
- BIO_snprintf(buf, sizeof buf, "%s_min", type);
+ sprintf(buf, "%s_min", type);
if (!NCONF_get_number(req_conf, attr_sect, buf, &n_min)) {
ERR_clear_error();
n_min = -1;
}
- BIO_snprintf(buf, sizeof buf, "%s_max", type);
+ sprintf(buf, "%s_max", type);
if (!NCONF_get_number(req_conf, attr_sect, buf, &n_max)) {
ERR_clear_error();
n_max = -1;
@@ -1168,8 +1168,8 @@ static int add_DN_object(X509_NAME *n, char *text, const char *def,
BIO_printf(bio_err, "%s [%s]:", text, def);
(void)BIO_flush(bio_err);
if (value != NULL) {
- OPENSSL_strlcpy(buf, value, sizeof buf);
- OPENSSL_strlcat(buf, "\n", sizeof buf);
+ strcpy(buf, value);
+ strcat(buf, "\n");
BIO_printf(bio_err, "%s\n", value);
} else {
buf[0] = '\0';
@@ -1187,8 +1187,8 @@ static int add_DN_object(X509_NAME *n, char *text, const char *def,
if (buf[0] == '\n') {
if ((def == NULL) || (def[0] == '\0'))
return 1;
- OPENSSL_strlcpy(buf, def, sizeof buf);
- OPENSSL_strlcat(buf, "\n", sizeof buf);
+ strcpy(buf, def);
+ strcat(buf, "\n");
} else if ((buf[0] == '.') && (buf[1] == '\n')) {
return 1;
}
@@ -1228,8 +1228,8 @@ static int add_attribute_object(X509_REQ *req, char *text, const char *def,
BIO_printf(bio_err, "%s [%s]:", text, def);
(void)BIO_flush(bio_err);
if (value != NULL) {
- OPENSSL_strlcpy(buf, value, sizeof buf);
- OPENSSL_strlcat(buf, "\n", sizeof buf);
+ strcpy(buf, value);
+ strcat(buf, "\n");
BIO_printf(bio_err, "%s\n", value);
} else {
buf[0] = '\0';
@@ -1247,8 +1247,8 @@ static int add_attribute_object(X509_REQ *req, char *text, const char *def,
if (buf[0] == '\n') {
if ((def == NULL) || (def[0] == '\0'))
return 1;
- OPENSSL_strlcpy(buf, def, sizeof buf);
- OPENSSL_strlcat(buf, "\n", sizeof buf);
+ strcpy(buf, def);
+ strcat(buf, "\n");
} else if ((buf[0] == '.') && (buf[1] == '\n')) {
return 1;
}
diff --git a/apps/s_time.c b/apps/s_time.c
index bae2524af5..c4f4037363 100644
--- a/apps/s_time.c
+++ b/apps/s_time.c
@@ -173,7 +173,7 @@ int s_time_main(int argc, char **argv)
break;
case OPT_WWW:
www_path = opt_arg();
- buf_size = strlen(www_path) + sizeof(fmt_http_get_cmd) - 2; /* 2 is for %s */
+ buf_size = strlen(www_path) + sizeof(fmt_http_get_cmd);
if (buf_size > sizeof(buf)) {
BIO_printf(bio_err, "%s: -www option is too long\n", prog);
goto end;
@@ -230,8 +230,8 @@ int s_time_main(int argc, char **argv)
goto end;
if (www_path != NULL) {
- buf_len = BIO_snprintf(buf, sizeof buf,
- fmt_http_get_cmd, www_path);
+ sprintf(buf, fmt_http_get_cmd, www_path);
+ buf_len = strlen(buf);
if (SSL_write(scon, buf, buf_len) <= 0)
goto end;
while ((i = SSL_read(scon, buf, sizeof(buf))) > 0)
@@ -288,8 +288,8 @@ int s_time_main(int argc, char **argv)
}
if (www_path != NULL) {
- buf_len = BIO_snprintf(buf, sizeof buf,
- fmt_http_get_cmd, www_path);
+ sprintf(buf, fmt_http_get_cmd, www_path);
+ buf_len = strlen(buf);
if (SSL_write(scon, buf, buf_len) <= 0)
goto end;
while (SSL_read(scon, buf, sizeof(buf)) > 0)
@@ -319,8 +319,7 @@ int s_time_main(int argc, char **argv)
goto end;
if (www_path != NULL) {
- BIO_snprintf(buf, sizeof buf, "GET %s HTTP/1.0\r\n\r\n",
- www_path);
+ sprintf(buf, "GET %s HTTP/1.0\r\n\r\n", www_path);
if (SSL_write(scon, buf, strlen(buf)) <= 0)
goto end;
while ((i = SSL_read(scon, buf, sizeof(buf))) > 0)
diff --git a/apps/x509.c b/apps/x509.c
index 689d5a2465..484192bbf1 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -906,15 +906,15 @@ static ASN1_INTEGER *x509_load_serial(const char *CAfile, const char *serialfile
: (strlen(serialfile))) + 1;
buf = app_malloc(len, "serial# buffer");
if (serialfile == NULL) {
- OPENSSL_strlcpy(buf, CAfile, len);
+ strcpy(buf, CAfile);
for (p = buf; *p; p++)
if (*p == '.') {
*p = '\0';
break;
}
- OPENSSL_strlcat(buf, POSTFIX, len);
+ strcat(buf, POSTFIX);
} else {
- OPENSSL_strlcpy(buf, serialfile, len);
+ strcpy(buf, serialfile);
}
serial = load_serial(buf, create, NULL);
diff --git a/crypto/asn1/a_gentm.c b/crypto/asn1/a_gentm.c
index bd90d05114..2c5fb1c3d2 100644
--- a/crypto/asn1/a_gentm.c
+++ b/crypto/asn1/a_gentm.c
@@ -237,9 +237,9 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
tmps->data = (unsigned char *)p;
}
- BIO_snprintf(p, len, "%04d%02d%02d%02d%02d%02dZ", ts->tm_year + 1900,
- ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min,
- ts->tm_sec);
+ sprintf(p, "%04d%02d%02d%02d%02d%02dZ", ts->tm_year + 1900,
+ ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min,
+ ts->tm_sec);
tmps->length = strlen(p);
tmps->type = V_ASN1_GENERALIZEDTIME;
#ifdef CHARSET_EBCDIC_not
diff --git a/crypto/asn1/a_mbstr.c b/crypto/asn1/a_mbstr.c
index 5578e92397..46764b292c 100644
--- a/crypto/asn1/a_mbstr.c
+++ b/crypto/asn1/a_mbstr.c
@@ -100,14 +100,14 @@ int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
if ((minsize > 0) && (nchar < minsize)) {
ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_STRING_TOO_SHORT);
- BIO_snprintf(strbuf, sizeof strbuf, "%ld", minsize);
+ sprintf(strbuf, "%ld", minsize);
ERR_add_error_data(2, "minsize=", strbuf);
return -1;
}
if ((maxsize > 0) && (nchar > maxsize)) {
ASN1err(ASN1_F_ASN1_MBSTRING_NCOPY, ASN1_R_STRING_TOO_LONG);
- BIO_snprintf(strbuf, sizeof strbuf, "%ld", maxsize);
+ sprintf(strbuf, "%ld", maxsize);
ERR_add_error_data(2, "maxsize=", strbuf);
return -1;
}
diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c
index 12b1ff5890..f0ec42f71c 100644
--- a/crypto/asn1/a_time.c
+++ b/crypto/asn1/a_time.c
@@ -64,7 +64,6 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t,
{
ASN1_GENERALIZEDTIME *ret = NULL;
char *str;
- int newlen;
if (!ASN1_TIME_check(t))
return NULL;
@@ -85,16 +84,14 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t,
/* grow the string */
if (!ASN1_STRING_set(ret, NULL, t->length + 2))
goto err;
- /* ASN1_STRING_set() allocated 'len + 1' bytes. */
- newlen = t->length + 2 + 1;
str = (char *)ret->data;
/* Work out the century and prepend */
if (t->data[0] >= '5')
- OPENSSL_strlcpy(str, "19", newlen);
+ strcpy(str, "19");
else
- OPENSSL_strlcpy(str, "20", newlen);
+ strcpy(str, "20");
- OPENSSL_strlcat(str, (const char *)t->data, newlen);
+ strcat(str, (const char *)t->data);
done:
if (out != NULL && *out == NULL)
diff --git a/crypto/asn1/a_utctm.c b/crypto/asn1/a_utctm.c
index ee98e4b489..25393ee152 100644
--- a/crypto/asn1/a_utctm.c
+++ b/crypto/asn1/a_utctm.c
@@ -199,9 +199,9 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
s->data = (unsigned char *)p;
}
- BIO_snprintf(p, len, "%02d%02d%02d%02d%02d%02dZ", ts->tm_year % 100,
- ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min,
- ts->tm_sec);
+ sprintf(p, "%02d%02d%02d%02d%02d%02dZ", ts->tm_year % 100,
+ ts->tm_mon + 1, ts->tm_mday, ts->tm_hour, ts->tm_min,
+ ts->tm_sec);
s->length = strlen(p);
s->type = V_ASN1_UTCTIME;
#ifdef CHARSET_EBCDIC_not
diff --git a/crypto/asn1/asn1_par.c b/crypto/asn1/asn1_par.c
index af045cb15e..19b21e7d49 100644
--- a/crypto/asn1/asn1_par.c
+++ b/crypto/asn1/asn1_par.c
@@ -38,13 +38,13 @@ static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
p = str;
if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
- BIO_snprintf(str, sizeof str, "priv [ %d ] ", tag);
+ sprintf(str, "priv [ %d ] ", tag);
else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
- BIO_snprintf(str, sizeof str, "cont [ %d ]", tag);
+ sprintf(str, "cont [ %d ]", tag);
else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
- BIO_snprintf(str, sizeof str, "appl [ %d ]", tag);
+ sprintf(str, "appl [ %d ]", tag);
else if (tag > 30)
- BIO_snprintf(str, sizeof str, "<ASN1 %d>", tag);
+ sprintf(str, "<ASN1 %d>", tag);
else
p = ASN1_tag2str(tag);
diff --git a/crypto/asn1/x_long.c b/crypto/asn1/x_long.c
index 4bb66114ba..78f4b764c3 100644
--- a/crypto/asn1/x_long.c
+++ b/crypto/asn1/x_long.c
@@ -89,12 +89,8 @@ static int long_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,
long ltmp;
unsigned long utmp, sign;
int clen, pad, i;
- /* this exists to bypass broken gcc optimization */
- char *cp = (char *)pval;
-
- /* use memcpy, because we may not be long aligned */
- memcpy(&ltmp, cp, sizeof(long));
+ ltmp = *(long *)pval;
if (ltmp == it->size)
return -1;
/*
@@ -136,7 +132,6 @@ static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
int i;
long ltmp;
unsigned long utmp = 0, sign = 0x100;
- char *cp = (char *)pval;
if (len > 1) {
/*
@@ -188,7 +183,7 @@ static int long_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
ASN1err(ASN1_F_LONG_C2I, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG);
return 0;
}
- memcpy(cp, &ltmp, sizeof(long));
+ *(long*)pval = ltmp;
return 1;
}
diff --git a/crypto/bio/b_dump.c b/crypto/bio/b_dump.c
index a27954fa34..491b973369 100644
--- a/crypto/bio/b_dump.c
+++ b/crypto/bio/b_dump.c
@@ -54,36 +54,34 @@ 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++) {
- OPENSSL_strlcpy(buf, str, sizeof buf);
- BIO_snprintf(tmp, sizeof tmp, "%04x - ", i * dump_width);
- OPENSSL_strlcat(buf, tmp, sizeof buf);
+ strcpy(buf, str);
+ sprintf(tmp, "%04x - ", i * dump_width);
+ strcat(buf, tmp);
for (j = 0; j < dump_width; j++) {
if (((i * dump_width) + j) >= len) {
- OPENSSL_strlcat(buf, " ", sizeof buf);
+ strcat(buf, " ");
} else {
ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
- BIO_snprintf(tmp, sizeof tmp, "%02x%c", ch,
- j == 7 ? '-' : ' ');
- OPENSSL_strlcat(buf, tmp, sizeof buf);
+ sprintf(tmp, "%02x%c", ch, j == 7 ? '-' : ' ');
+ strcat(buf, tmp);
}
}
- OPENSSL_strlcat(buf, " ", sizeof buf);
+ strcat(buf, " ");
for (j = 0; j < dump_width; j++) {
if (((i * dump_width) + j) >= len)
break;
ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
#ifndef CHARSET_EBCDIC
- BIO_snprintf(tmp, sizeof tmp, "%c",
- ((ch >= ' ') && (ch <= '~')) ? ch : '.');
+ sprintf(tmp, "%c", ((ch >= ' ') && (ch <= '~')) ? ch : '.');
#else
- BIO_snprintf(tmp, sizeof tmp, "%c",
+ sprintf(tmp, "%c",
((ch >= os_toascii[' ']) && (ch <= os_toascii['~']))
? os_toebcdic[ch]
: '.');
#endif
- OPENSSL_strlcat(buf, tmp, sizeof buf);
+ strcat(buf, tmp);
}
- OPENSSL_strlcat(buf, "\n", sizeof buf);
+ strcat(buf, "\n");
/*
* if this is the last call then update the ddt_dump thing so that we
* will move the selection point in the debug window
@@ -92,8 +90,7 @@ int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),
}
#ifdef TRUNCATE
if (trc > 0) {
- BIO_snprintf(buf, sizeof buf, "%s%04x - <SPACES/NULS>\n", str,
- len + trc);
+ sprintf(buf, "%s%04x - <SPACES/NULS>\n", str, len + trc);
ret += cb((void *)buf, strlen(buf), u);
}
#endif
diff --git a/crypto/bio/bio_cb.c b/crypto/bio/bio_cb.c
index 69ea3d067e..13368e82ee 100644
--- a/crypto/bio/bio_cb.c
+++ b/crypto/bio/bio_cb.c
@@ -22,69 +22,67 @@ long BIO_debug_callback(BIO *bio, int cmd, const char *argp,
char *p;
long r = 1;
int len;
- size_t p_maxlen;
if (BIO_CB_RETURN & cmd)
r = ret;
- len = BIO_snprintf(buf, sizeof buf, "BIO[%p]: ", (void *)bio);
+ len = sprintf(buf, "BIO[%p]: ", (void *)bio);
/* Ignore errors and continue printing the other information. */
if (len < 0)
len = 0;
p = buf + len;
- p_maxlen = sizeof(buf) - len;
switch (cmd) {
case BIO_CB_FREE:
- BIO_snprintf(p, p_maxlen, "Free - %s\n", bio->method->name);
+ sprintf(p, "Free - %s\n", bio->method->name);
break;
case BIO_CB_READ:
if (bio->method->type & BIO_TYPE_DESCRIPTOR)
- BIO_snprintf(p, p_maxlen, "read(%d,%lu) - %s fd=%d\n",
- bio->num, (unsigned long)argi,
- bio->method->name, bio->num);
+ sprintf(p, "read(%d,%lu) - %s fd=%d\n",
+ bio->num, (unsigned long)argi,
+ bio->method->name, bio->num);
else
- BIO_snprintf(p, p_maxlen, "read(%d,%lu) - %s\n",
- bio->num, (unsigned long)argi, bio->method->name);
+ sprintf(p, "read(%d,%lu) - %s\n",
+ bio->num, (unsigned long)argi, bio->method->name);
break;
case BIO_CB_WRITE:
if (bio->method->type & BIO_TYPE_DESCRIPTOR)
- BIO_snprintf(p, p_maxlen, "write(%d,%lu) - %s fd=%d\n",
- bio->num, (unsigned long)argi,
- bio->method->name, bio->num);
+ sprintf(p, "write(%d,%lu) - %s fd=%d\n",
+ bio->num, (unsigned long)argi,
+ bio->method->name, bio->num);
else
- BIO_snprintf(p, p_maxlen, "write(%d,%lu) - %s\n",
- bio->num, (unsigned long)argi, bio->method->name);
+ sprintf(p, "write(%d,%lu) - %s\n",
+ bio->num, (unsigned long)argi, bio->method->name);
break;
case BIO_CB_PUTS:
- BIO_snprintf(p, p_maxlen, "puts() - %s\n", bio->method->name);
+ sprintf(p, "puts() - %s\n", bio->method->name);
break;
case BIO_CB_GETS:
- BIO_snprintf(p, p_maxlen, "gets(%lu) - %s\n", (unsigned long)argi,
- bio->method->name);
+ sprintf(p, "gets(%lu) - %s\n", (unsigned long)argi,
+ bio->method->name);
break;
case BIO_CB_CTRL:
- BIO_snprintf(p, p_maxlen, "ctrl(%lu) - %s\n", (unsigned long)argi,
- bio->method->name);
+ sprintf(p, "ctrl(%lu) - %s\n", (unsigned long)argi,
+ bio->method->name);
break;
case BIO_CB_RETURN | BIO_CB_READ:
- BIO_snprintf(p, p_maxlen, "read return %ld\n", ret);
+ sprintf(p, "read return %ld\n", ret);
break;
case BIO_CB_RETURN | BIO_CB_WRITE:
- BIO_snprintf(p, p_maxlen, "write return %ld\n", ret);
+ sprintf(p, "write return %ld\n", ret);
break;
case BIO_CB_RETURN | BIO_CB_GETS:
- BIO_snprintf(p, p_maxlen, "gets return %ld\n", ret);
+ sprintf(p, "gets return %ld\n", ret);
break;
case BIO_CB_RETURN | BIO_CB_PUTS:
- BIO_snprintf(p, p_maxlen, "puts return %ld\n", ret);
+ sprintf(p, "puts return %ld\n", ret);
break;
case BIO_CB_RETURN | BIO_CB_CTRL:
- BIO_snprintf(p, p_maxlen, "ctrl return %ld\n", ret);
+ sprintf(p, "ctrl return %ld\n", ret);
break;
default:
- BIO_snprintf(p, p_maxlen, "bio callback - unknown type (%d)\n", cmd);
+ sprintf(p, "bio callback - unknown type (%d)\n", cmd);
break;
}
diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c
index ae9867e037..49d8f09bc5 100644
--- a/crypto/bio/bss_file.c
+++ b/crypto/bio/bss_file.c
@@ -271,15 +271,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)
- OPENSSL_strlcpy(p, "a+", sizeof p);
+ strcpy(p, "a+");
else
- OPENSSL_strlcpy(p, "a", sizeof p);
+ strcpy(p, "a");
} else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE))
- OPENSSL_strlcpy(p, "r+", sizeof p);
+ strcpy(p, "r+");
else if (num & BIO_FP_WRITE)
- OPENSSL_strlcpy(p, "w", sizeof p);
+ strcpy(p, "w");
else if (num & BIO_FP_READ)
- OPENSSL_strlcpy(p, "r", sizeof p);
+ strcpy(p, "r");
else {
BIOerr(BIO_F_FILE_CTRL, BIO_R_BAD_FOPEN_MODE);
ret = 0;
diff --git a/crypto/bn/bn_print.c b/crypto/bn/bn_print.c
index 821676067b..708067aa8a 100644
--- a/crypto/bn/bn_print.c
+++ b/crypto/bn/bn_print.c
@@ -77,7 +77,6 @@ char *BN_bn2dec(const BIGNUM *a)
if ((t = BN_dup(a)) == NULL)
goto err;
-#define BUF_REMAIN (num+3 - (size_t)(p - buf))
p = buf;
lp = bn_data;
if (BN_is_zero(t)) {
@@ -101,12 +100,12 @@ char *BN_bn2dec(const BIGNUM *a)
* the last one needs truncation. The blocks need to be reversed in
* order.
*/
- BIO_snprintf(p, BUF_REMAIN, BN_DEC_FMT1, *lp);
+ sprintf(p, BN_DEC_FMT1, *lp);
while (*p)
p++;
while (lp != bn_data) {
lp--;
- BIO_snprintf(p, BUF_REMAIN, BN_DEC_FMT2, *lp);
+ sprintf(p, BN_DEC_FMT2, *lp);
while (*p)
p++;
}
@@ -332,11 +331,11 @@ char *BN_options(void)
if (!init) {
init++;
#ifdef BN_LLONG
- BIO_snprintf(data, sizeof data, "bn(%d,%d)",
- (int)sizeof(BN_ULLONG) * 8, (int)sizeof(BN_ULONG) * 8);
+ sprintf(data, "bn(%d,%d)",
+ (int)sizeof(BN_ULLONG) * 8, (int)sizeof(BN_ULONG) * 8);
#else
- BIO_snprintf(data, sizeof data, "bn(%d,%d)",
- (int)sizeof(BN_ULONG) * 8, (int)sizeof(BN_ULONG) * 8);
+ sprintf(data, "bn(%d,%d)",
+ (int)sizeof(BN_ULONG) * 8, (int)sizeof(BN_ULONG) * 8);
#endif
}
return (data);
diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c
index a7b11d1598..78acdec4f6 100644
--- a/crypto/conf/conf_def.c
+++ b/crypto/conf/conf_def.c
@@ -323,7 +323,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE);
goto err;
}
- OPENSSL_strlcpy(v->name, pname, strlen(pname) + 1);
+ strcpy(v->name, pname);
if (!str_copy(conf, psection, &(v->value), start))
goto err;
@@ -353,7 +353,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
OPENSSL_free(section);
if (line != NULL)
*line = eline;
- BIO_snprintf(btmp, sizeof btmp, "%ld", eline);
+ sprintf(btmp, "%ld", eline);
ERR_add_error_data(2, "line ", btmp);
if (h != conf->data) {
CONF_free(conf->data);
diff --git a/crypto/conf/conf_mod.c b/crypto/conf/conf_mod.c
index 31f838e0fa..33a96980bb 100644
--- a/crypto/conf/conf_mod.c
+++ b/crypto/conf/conf_mod.c
@@ -171,7 +171,7 @@ static int module_run(const CONF *cnf, const char *name, const char *value,
if (!(flags & CONF_MFLAGS_SILENT)) {
char rcode[DECIMAL_SIZE(ret) + 1];
CONFerr(CONF_F_MODULE_RUN, CONF_R_MODULE_INITIALIZATION_ERROR);
- BIO_snprintf(rcode, sizeof rcode, "%-8d", ret);
+ sprintf(rcode, "%-8d", ret);
ERR_add_error_data(6, "module=", name, ", value=", value,
", retcode=", rcode);
}
@@ -492,11 +492,11 @@ char *CONF_get1_default_config_file(void)
if (file == NULL)
return NULL;
- OPENSSL_strlcpy(file, X509_get_default_cert_area(), len + 1);
+ strcpy(file, X509_get_default_cert_area());
#ifndef OPENSSL_SYS_VMS
- OPENSSL_strlcat(file, "/", len + 1);
+ strcat(file, "/");
#endif
- OPENSSL_strlcat(file, OPENSSL_CONF, len + 1);
+ strcat(file, OPENSSL_CONF);
return file;
}
diff --git a/crypto/cversion.c b/crypto/cversion.c
index 96d8a5b5e0..4e00702e04 100644
--- a/crypto/cversion.c
+++ b/crypto/cversion.c
@@ -9,9 +9,7 @@
#include "internal/cryptlib.h"
-#ifndef NO_WINDOWS_BRAINDEATH
-# include "buildinf.h"
-#endif
+#include "buildinf.h"
unsigned long OpenSSL_version_num(void)
{
diff --git a/crypto/des/ecb_enc.c b/crypto/des/ecb_enc.c
index bd130c6e03..0b292a2115 100644
--- a/crypto/des/ecb_enc.c
+++ b/crypto/des/ecb_enc.c
@@ -24,7 +24,7 @@ const char *DES_options(void)
size = "int";
else
size = "long";
- BIO_snprintf(buf, sizeof buf, "des(%s)", size);
+ sprintf(buf, "des(%s)", size);
init = 0;
}
return (buf);
diff --git a/crypto/engine/eng_ctrl.c b/crypto/engine/eng_ctrl.c
index 7925f4fadf..81681118b0 100644
--- a/crypto/engine/eng_ctrl.c
+++ b/crypto/engine/eng_ctrl.c
@@ -109,19 +109,15 @@ static int int_ctrl_helper(ENGINE *e, int cmd, long i, void *p,
case ENGINE_CTRL_GET_NAME_LEN_FROM_CMD:
return strlen(e->cmd_defns[idx].cmd_name);
case ENGINE_CTRL_GET_NAME_FROM_CMD:
- return BIO_snprintf(s, strlen(e->cmd_defns[idx].cmd_name) + 1,
- "%s", e->cmd_defns[idx].cmd_name);
+ return sprintf(s, "%s", e->cmd_defns[idx].cmd_name);
case ENGINE_CTRL_GET_DESC_LEN_FROM_CMD:
if (e->cmd_defns[idx].cmd_desc)
return strlen(e->cmd_defns[idx].cmd_desc);
return strlen(int_no_description);
case ENGINE_CTRL_GET_DESC_FROM_CMD:
if (e->cmd_defns[idx].cmd_desc)
- return BIO_snprintf(s,
- strlen(e->cmd_defns[idx].cmd_desc) + 1,
- "%s", e->cmd_defns[idx].cmd_desc);
- return BIO_snprintf(s, strlen(int_no_description) + 1, "%s",
- int_no_description);
+ return sprintf(s, "%s", e->cmd_defns[idx].cmd_desc);
+ return sprintf(s, "%s", int_no_description);
case ENGINE_CTRL_GET_CMD_FLAGS:
return e->cmd_defns[idx].cmd_flags;
}
diff --git a/crypto/evp/evp_pbe.c b/crypto/evp/evp_pbe.c
index ce7aa2cfa1..354532d8de 100644
--- a/crypto/evp/evp_pbe.c
+++ b/crypto/evp/evp_pbe.c
@@ -90,7 +90,7 @@ int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
char obj_tmp[80];
EVPerr(EVP_F_EVP_PBE_CIPHERINIT, EVP_R_UNKNOWN_PBE_ALGORITHM);
if (!pbe_obj)
- OPENSSL_strlcpy(obj_tmp, "NULL", sizeof obj_tmp);
+ strcpy(obj_tmp, "NULL");
else
i2t_ASN1_OBJECT(obj_tmp, sizeof obj_tmp, pbe_obj);
ERR_add_error_data(2, "TYPE=", obj_tmp);
diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c
index 4c4e7d3f12..c0bb2be1f1 100644
--- a/crypto/mem_dbg.c
+++ b/crypto/mem_dbg.c
@@ -467,24 +467,19 @@ static void print_leak(const MEM *m, MEM_LEAK *l)
} tid;
CRYPTO_THREAD_ID ti;