summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/asn1/a_time.c6
-rw-r--r--src/lib/libcrypto/bio/b_dump.c14
-rw-r--r--src/lib/libcrypto/bio/bss_file.c10
-rw-r--r--src/lib/libcrypto/conf/conf_def.c4
-rw-r--r--src/lib/libcrypto/dso/dso_lib.c4
-rw-r--r--src/lib/libcrypto/err/err.c2
-rw-r--r--src/lib/libcrypto/evp/evp_pbe.c2
-rw-r--r--src/lib/libcrypto/objects/obj_dat.c6
-rw-r--r--src/lib/libcrypto/pem/pem_lib.c12
-rw-r--r--src/lib/libcrypto/rand/randfile.c2
-rw-r--r--src/lib/libcrypto/ui/ui_lib.c12
-rw-r--r--src/lib/libcrypto/x509v3/v3_info.c6
12 files changed, 40 insertions, 40 deletions
diff --git a/src/lib/libcrypto/asn1/a_time.c b/src/lib/libcrypto/asn1/a_time.c
index f3f28369f4..1978e8d3dc 100644
--- a/src/lib/libcrypto/asn1/a_time.c
+++ b/src/lib/libcrypto/asn1/a_time.c
@@ -147,10 +147,10 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZE
147 newlen = t->length + 2 + 1; 147 newlen = t->length + 2 + 1;
148 str = (char *)ret->data; 148 str = (char *)ret->data;
149 /* Work out the century and prepend */ 149 /* Work out the century and prepend */
150 if (t->data[0] >= '5') BUF_strlcpy(str, "19", newlen); 150 if (t->data[0] >= '5') strlcpy(str, "19", newlen);
151 else BUF_strlcpy(str, "20", newlen); 151 else strlcpy(str, "20", newlen);
152 152
153 BUF_strlcat(str, (char *)t->data, newlen); 153 strlcat(str, (char *)t->data, newlen);
154 154
155 return ret; 155 return ret;
156} 156}
diff --git a/src/lib/libcrypto/bio/b_dump.c b/src/lib/libcrypto/bio/b_dump.c
index ff75069df8..61c9fe20a3 100644
--- a/src/lib/libcrypto/bio/b_dump.c
+++ b/src/lib/libcrypto/bio/b_dump.c
@@ -107,29 +107,29 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
107 rows++; 107 rows++;
108 for (i = 0; i < rows; i++) { 108 for (i = 0; i < rows; i++) {
109 buf[0] = '\0'; /* start with empty string */ 109 buf[0] = '\0'; /* start with empty string */
110 BUF_strlcpy(buf, str, sizeof buf); 110 strlcpy(buf, str, sizeof buf);
111 (void) snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width); 111 (void) snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width);
112 BUF_strlcat(buf, tmp, sizeof buf); 112 strlcat(buf, tmp, sizeof buf);
113 for (j = 0; j < dump_width; j++) { 113 for (j = 0; j < dump_width; j++) {
114 if (((i*dump_width) + j) >= len) { 114 if (((i*dump_width) + j) >= len) {
115 BUF_strlcat(buf, " ", sizeof buf); 115 strlcat(buf, " ", sizeof buf);
116 } else { 116 } else {
117 ch = ((unsigned char)*(s + i*dump_width + j)) & 0xff; 117 ch = ((unsigned char)*(s + i*dump_width + j)) & 0xff;
118 (void) snprintf(tmp, sizeof tmp, "%02x%c", ch, 118 (void) snprintf(tmp, sizeof tmp, "%02x%c", ch,
119 j == 7 ? '-' : ' '); 119 j == 7 ? '-' : ' ');
120 BUF_strlcat(buf, tmp, sizeof buf); 120 strlcat(buf, tmp, sizeof buf);
121 } 121 }
122 } 122 }
123 BUF_strlcat(buf, " ", sizeof buf); 123 strlcat(buf, " ", sizeof buf);
124 for (j = 0; j < dump_width; j++) { 124 for (j = 0; j < dump_width; j++) {
125 if (((i*dump_width) + j) >= len) 125 if (((i*dump_width) + j) >= len)
126 break; 126 break;
127 ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff; 127 ch = ((unsigned char)*(s + i * dump_width + j)) & 0xff;
128 (void) snprintf(tmp, sizeof tmp, "%c", 128 (void) snprintf(tmp, sizeof tmp, "%c",
129 ((ch >= ' ') && (ch <= '~')) ? ch : '.'); 129 ((ch >= ' ') && (ch <= '~')) ? ch : '.');
130 BUF_strlcat(buf, tmp, sizeof buf); 130 strlcat(buf, tmp, sizeof buf);
131 } 131 }
132 BUF_strlcat(buf, "\n", sizeof buf); 132 strlcat(buf, "\n", sizeof buf);
133 /* if this is the last call then update the ddt_dump thing so 133 /* if this is the last call then update the ddt_dump thing so
134 * that we will move the selection point in the debug window 134 * that we will move the selection point in the debug window
135 */ 135 */
diff --git a/src/lib/libcrypto/bio/bss_file.c b/src/lib/libcrypto/bio/bss_file.c
index 995c623341..acc746260e 100644
--- a/src/lib/libcrypto/bio/bss_file.c
+++ b/src/lib/libcrypto/bio/bss_file.c
@@ -246,14 +246,14 @@ file_ctrl(BIO *b, int cmd, long num, void *ptr)
246 b->shutdown = (int)num&BIO_CLOSE; 246 b->shutdown = (int)num&BIO_CLOSE;
247 if (num & BIO_FP_APPEND) { 247 if (num & BIO_FP_APPEND) {
248 if (num & BIO_FP_READ) 248 if (num & BIO_FP_READ)
249 BUF_strlcpy(p, "a+", sizeof p); 249 strlcpy(p, "a+", sizeof p);
250 else BUF_strlcpy(p, "a", sizeof p); 250 else strlcpy(p, "a", sizeof p);
251 } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE)) 251 } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE))
252 BUF_strlcpy(p, "r+", sizeof p); 252 strlcpy(p, "r+", sizeof p);
253 else if (num & BIO_FP_WRITE) 253 else if (num & BIO_FP_WRITE)
254 BUF_strlcpy(p, "w", sizeof p); 254 strlcpy(p, "w", sizeof p);
255 else if (num & BIO_FP_READ) 255 else if (num & BIO_FP_READ)
256 BUF_strlcpy(p, "r", sizeof p); 256 strlcpy(p, "r", sizeof p);
257 else { 257 else {
258 BIOerr(BIO_F_FILE_CTRL, BIO_R_BAD_FOPEN_MODE); 258 BIOerr(BIO_F_FILE_CTRL, BIO_R_BAD_FOPEN_MODE);
259 ret = 0; 259 ret = 0;
diff --git a/src/lib/libcrypto/conf/conf_def.c b/src/lib/libcrypto/conf/conf_def.c
index 39e8b8e521..26aee50a45 100644
--- a/src/lib/libcrypto/conf/conf_def.c
+++ b/src/lib/libcrypto/conf/conf_def.c
@@ -230,7 +230,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
230 CONFerr(CONF_F_DEF_LOAD_BIO,ERR_R_MALLOC_FAILURE); 230 CONFerr(CONF_F_DEF_LOAD_BIO,ERR_R_MALLOC_FAILURE);
231 goto err; 231 goto err;
232 } 232 }
233 BUF_strlcpy(section,"default",10); 233 strlcpy(section,"default",10);
234 234
235 if (_CONF_new_data(conf) == 0) 235 if (_CONF_new_data(conf) == 0)
236 { 236 {
@@ -384,7 +384,7 @@ again:
384 ERR_R_MALLOC_FAILURE); 384 ERR_R_MALLOC_FAILURE);
385 goto err; 385 goto err;
386 } 386 }
387 BUF_strlcpy(v->name,pname,strlen(pname)+1); 387 strlcpy(v->name,pname,strlen(pname)+1);
388 if (!str_copy(conf,psection,&(v->value),start)) goto err; 388 if (!str_copy(conf,psection,&(v->value),start)) goto err;
389 389
390 if (strcmp(psection,section) != 0) 390 if (strcmp(psection,section) != 0)
diff --git a/src/lib/libcrypto/dso/dso_lib.c b/src/lib/libcrypto/dso/dso_lib.c
index 00e65938b9..2f77242d47 100644
--- a/src/lib/libcrypto/dso/dso_lib.c
+++ b/src/lib/libcrypto/dso/dso_lib.c
@@ -373,7 +373,7 @@ int DSO_set_filename(DSO *dso, const char *filename)
373 DSOerr(DSO_F_DSO_SET_FILENAME,ERR_R_MALLOC_FAILURE); 373 DSOerr(DSO_F_DSO_SET_FILENAME,ERR_R_MALLOC_FAILURE);
374 return(0); 374 return(0);
375 } 375 }
376 BUF_strlcpy(copied, filename, strlen(filename) + 1); 376 strlcpy(copied, filename, strlen(filename) + 1);
377 if(dso->filename) 377 if(dso->filename)
378 free(dso->filename); 378 free(dso->filename);
379 dso->filename = copied; 379 dso->filename = copied;
@@ -432,7 +432,7 @@ char *DSO_convert_filename(DSO *dso, const char *filename)
432 ERR_R_MALLOC_FAILURE); 432 ERR_R_MALLOC_FAILURE);
433 return(NULL); 433 return(NULL);
434 } 434 }
435 BUF_strlcpy(result, filename, strlen(filename) + 1); 435 strlcpy(result, filename, strlen(filename) + 1);
436 } 436 }
437 return(result); 437 return(result);
438 } 438 }
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c
index 27a19bc52c..0672477cc8 100644
--- a/src/lib/libcrypto/err/err.c
+++ b/src/lib/libcrypto/err/err.c
@@ -1071,7 +1071,7 @@ void ERR_add_error_vdata(int num, va_list args)
1071 else 1071 else
1072 str=p; 1072 str=p;
1073 } 1073 }
1074 BUF_strlcat(str,a,(size_t)s+1); 1074 strlcat(str,a,(size_t)s+1);
1075 } 1075 }
1076 } 1076 }
1077 ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING); 1077 ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING);
diff --git a/src/lib/libcrypto/evp/evp_pbe.c b/src/lib/libcrypto/evp/evp_pbe.c
index c808b96fef..37a926c3fc 100644
--- a/src/lib/libcrypto/evp/evp_pbe.c
+++ b/src/lib/libcrypto/evp/evp_pbe.c
@@ -165,7 +165,7 @@ int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen,
165 { 165 {
166 char obj_tmp[80]; 166 char obj_tmp[80];
167 EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_UNKNOWN_PBE_ALGORITHM); 167 EVPerr(EVP_F_EVP_PBE_CIPHERINIT,EVP_R_UNKNOWN_PBE_ALGORITHM);
168 if (!pbe_obj) BUF_strlcpy (obj_tmp, "NULL", sizeof obj_tmp); 168 if (!pbe_obj) strlcpy (obj_tmp, "NULL", sizeof obj_tmp);
169 else i2t_ASN1_OBJECT(obj_tmp, sizeof obj_tmp, pbe_obj); 169 else i2t_ASN1_OBJECT(obj_tmp, sizeof obj_tmp, pbe_obj);
170 ERR_add_error_data(2, "TYPE=", obj_tmp); 170 ERR_add_error_data(2, "TYPE=", obj_tmp);
171 return 0; 171 return 0;
diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c
index cf4db7c6b5..b3388b117d 100644
--- a/src/lib/libcrypto/objects/obj_dat.c
+++ b/src/lib/libcrypto/objects/obj_dat.c
@@ -486,7 +486,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
486 if (s) 486 if (s)
487 { 487 {
488 if (buf) 488 if (buf)
489 BUF_strlcpy(buf,s,buf_len); 489 strlcpy(buf,s,buf_len);
490 n=strlen(s); 490 n=strlen(s);
491 return n; 491 return n;
492 } 492 }
@@ -576,7 +576,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
576 *buf++ = '.'; 576 *buf++ = '.';
577 buf_len--; 577 buf_len--;
578 } 578 }
579 BUF_strlcpy(buf,bndec,buf_len); 579 strlcpy(buf,bndec,buf_len);
580 if (i > buf_len) 580 if (i > buf_len)
581 { 581 {
582 buf += buf_len; 582 buf += buf_len;
@@ -598,7 +598,7 @@ int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
598 i=strlen(tbuf); 598 i=strlen(tbuf);
599 if (buf && (buf_len > 0)) 599 if (buf && (buf_len > 0))
600 { 600 {
601 BUF_strlcpy(buf,tbuf,buf_len); 601 strlcpy(buf,tbuf,buf_len);
602 if (i > buf_len) 602 if (i > buf_len)
603 { 603 {
604 buf += buf_len; 604 buf += buf_len;
diff --git a/src/lib/libcrypto/pem/pem_lib.c b/src/lib/libcrypto/pem/pem_lib.c
index aa6a4c9387..93736455fa 100644
--- a/src/lib/libcrypto/pem/pem_lib.c
+++ b/src/lib/libcrypto/pem/pem_lib.c
@@ -137,9 +137,9 @@ void PEM_proc_type(char *buf, int type)
137 else 137 else
138 str="BAD-TYPE"; 138 str="BAD-TYPE";
139 139
140 BUF_strlcat(buf,"Proc-Type: 4,",PEM_BUFSIZE); 140 strlcat(buf,"Proc-Type: 4,",PEM_BUFSIZE);
141 BUF_strlcat(buf,str,PEM_BUFSIZE); 141 strlcat(buf,str,PEM_BUFSIZE);
142 BUF_strlcat(buf,"\n",PEM_BUFSIZE); 142 strlcat(buf,"\n",PEM_BUFSIZE);
143 } 143 }
144 144
145void PEM_dek_info(char *buf, const char *type, int len, char *str) 145void PEM_dek_info(char *buf, const char *type, int len, char *str)
@@ -148,9 +148,9 @@ void PEM_dek_info(char *buf, const char *type, int len, char *str)
148 long i; 148 long i;
149 int j; 149 int j;
150 150
151 BUF_strlcat(buf,"DEK-Info: ",PEM_BUFSIZE); 151 strlcat(buf,"DEK-Info: ",PEM_BUFSIZE);
152 BUF_strlcat(buf,type,PEM_BUFSIZE); 152 strlcat(buf,type,PEM_BUFSIZE);
153 BUF_strlcat(buf,",",PEM_BUFSIZE); 153 strlcat(buf,",",PEM_BUFSIZE);
154 j=strlen(buf); 154 j=strlen(buf);
155 if (j + (len * 2) + 1 > PEM_BUFSIZE) 155 if (j + (len * 2) + 1 > PEM_BUFSIZE)
156 return; 156 return;
diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c
index 2525804668..5326f710c5 100644
--- a/src/lib/libcrypto/rand/randfile.c
+++ b/src/lib/libcrypto/rand/randfile.c
@@ -142,7 +142,7 @@ err:
142 142
143const char *RAND_file_name(char *buf, size_t size) 143const char *RAND_file_name(char *buf, size_t size)
144{ 144{
145 if (BUF_strlcpy(buf,"/dev/urandom",size) >= size) 145 if (strlcpy(buf,"/dev/urandom",size) >= size)
146 return(NULL); 146 return(NULL);
147 return buf; 147 return buf;
148} 148}
diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c
index fc03d9b7d4..58e4c5d722 100644
--- a/src/lib/libcrypto/ui/ui_lib.c
+++ b/src/lib/libcrypto/ui/ui_lib.c
@@ -409,13 +409,13 @@ UI_construct_prompt(UI *ui, const char *object_desc, const char *object_name)
409 len += sizeof(prompt3) - 1; 409 len += sizeof(prompt3) - 1;
410 410
411 prompt = (char *)malloc(len + 1); 411 prompt = (char *)malloc(len + 1);
412 BUF_strlcpy(prompt, prompt1, len + 1); 412 strlcpy(prompt, prompt1, len + 1);
413 BUF_strlcat(prompt, object_desc, len + 1); 413 strlcat(prompt, object_desc, len + 1);
414 if (object_name) { 414 if (object_name) {
415 BUF_strlcat(prompt, prompt2, len + 1); 415 strlcat(prompt, prompt2, len + 1);
416 BUF_strlcat(prompt, object_name, len + 1); 416 strlcat(prompt, object_name, len + 1);
417 } 417 }
418 BUF_strlcat(prompt, prompt3, len + 1); 418 strlcat(prompt, prompt3, len + 1);
419 } 419 }
420 return prompt; 420 return prompt;
421} 421}
@@ -869,7 +869,7 @@ UI_set_result(UI *ui, UI_STRING *uis, const char *result)
869 UIerr(UI_F_UI_SET_RESULT, UI_R_NO_RESULT_BUFFER); 869 UIerr(UI_F_UI_SET_RESULT, UI_R_NO_RESULT_BUFFER);
870 return -1; 870 return -1;
871 } 871 }
872 BUF_strlcpy(uis->result_buf, result, 872 strlcpy(uis->result_buf, result,
873 uis->_.string_data.result_maxsize + 1); 873 uis->_.string_data.result_maxsize + 1);
874 break; 874 break;
875 case UIT_BOOLEAN: 875 case UIT_BOOLEAN:
diff --git a/src/lib/libcrypto/x509v3/v3_info.c b/src/lib/libcrypto/x509v3/v3_info.c
index 2b290ca00c..c9d6c97b51 100644
--- a/src/lib/libcrypto/x509v3/v3_info.c
+++ b/src/lib/libcrypto/x509v3/v3_info.c
@@ -121,9 +121,9 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD *method
121 ERR_R_MALLOC_FAILURE); 121 ERR_R_MALLOC_FAILURE);
122 return NULL; 122 return NULL;
123 } 123 }
124 BUF_strlcpy(ntmp, objtmp, nlen); 124 strlcpy(ntmp, objtmp, nlen);
125 BUF_strlcat(ntmp, " - ", nlen); 125 strlcat(ntmp, " - ", nlen);
126 BUF_strlcat(ntmp, vtmp->name, nlen); 126 strlcat(ntmp, vtmp->name, nlen);
127 free(vtmp->name); 127 free(vtmp->name);
128 vtmp->name = ntmp; 128 vtmp->name = ntmp;
129 129