summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bio')
-rw-r--r--src/lib/libcrypto/bio/b_dump.c8
-rw-r--r--src/lib/libcrypto/bio/b_sock.c4
-rw-r--r--src/lib/libcrypto/bio/bio_cb.c30
-rw-r--r--src/lib/libcrypto/bio/bss_conn.c4
4 files changed, 23 insertions, 23 deletions
diff --git a/src/lib/libcrypto/bio/b_dump.c b/src/lib/libcrypto/bio/b_dump.c
index 61c9fe20a3..740686c957 100644
--- a/src/lib/libcrypto/bio/b_dump.c
+++ b/src/lib/libcrypto/bio/b_dump.c
@@ -108,14 +108,14 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
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 strlcpy(buf, str, sizeof buf); 110 strlcpy(buf, str, sizeof buf);
111 (void) snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width); 111 snprintf(tmp, sizeof tmp, "%04x - ", i*dump_width);
112 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 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 snprintf(tmp, sizeof tmp, "%02x%c", ch,
119 j == 7 ? '-' : ' '); 119 j == 7 ? '-' : ' ');
120 strlcat(buf, tmp, sizeof buf); 120 strlcat(buf, tmp, sizeof buf);
121 } 121 }
@@ -125,7 +125,7 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
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 snprintf(tmp, sizeof tmp, "%c",
129 ((ch >= ' ') && (ch <= '~')) ? ch : '.'); 129 ((ch >= ' ') && (ch <= '~')) ? ch : '.');
130 strlcat(buf, tmp, sizeof buf); 130 strlcat(buf, tmp, sizeof buf);
131 } 131 }
@@ -137,7 +137,7 @@ BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
137 } 137 }
138#ifdef TRUNCATE 138#ifdef TRUNCATE
139 if (trc > 0) { 139 if (trc > 0) {
140 (void) snprintf(buf, sizeof buf, "%s%04x - <SPACES/NULS>\n", 140 snprintf(buf, sizeof buf, "%s%04x - <SPACES/NULS>\n",
141 str, len + trc); 141 str, len + trc);
142 ret += cb((void *)buf, strlen(buf), u); 142 ret += cb((void *)buf, strlen(buf), u);
143 } 143 }
diff --git a/src/lib/libcrypto/bio/b_sock.c b/src/lib/libcrypto/bio/b_sock.c
index a82c79a1b0..a6dd43f397 100644
--- a/src/lib/libcrypto/bio/b_sock.c
+++ b/src/lib/libcrypto/bio/b_sock.c
@@ -543,7 +543,7 @@ BIO_accept(int sock, char **addr)
543 goto end; 543 goto end;
544 } 544 }
545 *addr = p; 545 *addr = p;
546 (void) snprintf(*addr, nl, "%s:%s", h, s); 546 snprintf(*addr, nl, "%s:%s", h, s);
547 goto end; 547 goto end;
548 } while (0); 548 } while (0);
549#endif 549#endif
@@ -558,7 +558,7 @@ BIO_accept(int sock, char **addr)
558 } 558 }
559 *addr = p; 559 *addr = p;
560 } 560 }
561 (void) snprintf(*addr, 24, "%d.%d.%d.%d:%d", 561 snprintf(*addr, 24, "%d.%d.%d.%d:%d",
562 (unsigned char)(l >> 24L) & 0xff, (unsigned char)(l >> 16L) & 0xff, 562 (unsigned char)(l >> 24L) & 0xff, (unsigned char)(l >> 16L) & 0xff,
563 (unsigned char)(l >> 8L) & 0xff, (unsigned char)(l) & 0xff, port); 563 (unsigned char)(l >> 8L) & 0xff, (unsigned char)(l) & 0xff, port);
564 564
diff --git a/src/lib/libcrypto/bio/bio_cb.c b/src/lib/libcrypto/bio/bio_cb.c
index a272bf969a..133d2b77dc 100644
--- a/src/lib/libcrypto/bio/bio_cb.c
+++ b/src/lib/libcrypto/bio/bio_cb.c
@@ -76,62 +76,62 @@ BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, long argl,
76 if (BIO_CB_RETURN & cmd) 76 if (BIO_CB_RETURN & cmd)
77 r = ret; 77 r = ret;
78 78
79 (void) snprintf(buf, sizeof buf, "BIO[%08lX]:", (unsigned long)bio); 79 snprintf(buf, sizeof buf, "BIO[%08lX]:", (unsigned long)bio);
80 p = &(buf[14]); 80 p = &(buf[14]);
81 p_maxlen = sizeof buf - 14; 81 p_maxlen = sizeof buf - 14;
82 switch (cmd) { 82 switch (cmd) {
83 case BIO_CB_FREE: 83 case BIO_CB_FREE:
84 (void) snprintf(p, p_maxlen, "Free - %s\n", bio->method->name); 84 snprintf(p, p_maxlen, "Free - %s\n", bio->method->name);
85 break; 85 break;
86 case BIO_CB_READ: 86 case BIO_CB_READ:
87 if (bio->method->type & BIO_TYPE_DESCRIPTOR) 87 if (bio->method->type & BIO_TYPE_DESCRIPTOR)
88 (void) snprintf(p, p_maxlen, 88 snprintf(p, p_maxlen,
89 "read(%d,%lu) - %s fd=%d\n", 89 "read(%d,%lu) - %s fd=%d\n",
90 bio->num, (unsigned long)argi, 90 bio->num, (unsigned long)argi,
91 bio->method->name, bio->num); 91 bio->method->name, bio->num);
92 else 92 else
93 (void) snprintf(p, p_maxlen, "read(%d,%lu) - %s\n", 93 snprintf(p, p_maxlen, "read(%d,%lu) - %s\n",
94 bio->num, (unsigned long)argi, bio->method->name); 94 bio->num, (unsigned long)argi, bio->method->name);
95 break; 95 break;
96 case BIO_CB_WRITE: 96 case BIO_CB_WRITE:
97 if (bio->method->type & BIO_TYPE_DESCRIPTOR) 97 if (bio->method->type & BIO_TYPE_DESCRIPTOR)
98 (void) snprintf(p, p_maxlen, 98 snprintf(p, p_maxlen,
99 "write(%d,%lu) - %s fd=%d\n", 99 "write(%d,%lu) - %s fd=%d\n",
100 bio->num, (unsigned long)argi, 100 bio->num, (unsigned long)argi,
101 bio->method->name, bio->num); 101 bio->method->name, bio->num);
102 else 102 else
103 (void) snprintf(p, p_maxlen, "write(%d,%lu) - %s\n", 103 snprintf(p, p_maxlen, "write(%d,%lu) - %s\n",
104 bio->num, (unsigned long)argi, bio->method->name); 104 bio->num, (unsigned long)argi, bio->method->name);
105 break; 105 break;
106 case BIO_CB_PUTS: 106 case BIO_CB_PUTS:
107 (void) snprintf(p, p_maxlen, 107 snprintf(p, p_maxlen,
108 "puts() - %s\n", bio->method->name); 108 "puts() - %s\n", bio->method->name);
109 break; 109 break;
110 case BIO_CB_GETS: 110 case BIO_CB_GETS:
111 (void) snprintf(p, p_maxlen, "gets(%lu) - %s\n", 111 snprintf(p, p_maxlen, "gets(%lu) - %s\n",
112 (unsigned long)argi, bio->method->name); 112 (unsigned long)argi, bio->method->name);
113 break; 113 break;
114 case BIO_CB_CTRL: 114 case BIO_CB_CTRL:
115 (void) snprintf(p, p_maxlen, "ctrl(%lu) - %s\n", 115 snprintf(p, p_maxlen, "ctrl(%lu) - %s\n",
116 (unsigned long)argi, bio->method->name); 116 (unsigned long)argi, bio->method->name);
117 break; 117 break;
118 case BIO_CB_RETURN|BIO_CB_READ: 118 case BIO_CB_RETURN|BIO_CB_READ:
119 (void) snprintf(p, p_maxlen, "read return %ld\n", ret); 119 snprintf(p, p_maxlen, "read return %ld\n", ret);
120 break; 120 break;
121 case BIO_CB_RETURN|BIO_CB_WRITE: 121 case BIO_CB_RETURN|BIO_CB_WRITE:
122 (void) snprintf(p, p_maxlen, "write return %ld\n", ret); 122 snprintf(p, p_maxlen, "write return %ld\n", ret);
123 break; 123 break;
124 case BIO_CB_RETURN|BIO_CB_GETS: 124 case BIO_CB_RETURN|BIO_CB_GETS:
125 (void) snprintf(p, p_maxlen, "gets return %ld\n", ret); 125 snprintf(p, p_maxlen, "gets return %ld\n", ret);
126 break; 126 break;
127 case BIO_CB_RETURN|BIO_CB_PUTS: 127 case BIO_CB_RETURN|BIO_CB_PUTS:
128 (void) snprintf(p, p_maxlen, "puts return %ld\n", ret); 128 snprintf(p, p_maxlen, "puts return %ld\n", ret);
129 break; 129 break;
130 case BIO_CB_RETURN|BIO_CB_CTRL: 130 case BIO_CB_RETURN|BIO_CB_CTRL:
131 (void) snprintf(p, p_maxlen, "ctrl return %ld\n", ret); 131 snprintf(p, p_maxlen, "ctrl return %ld\n", ret);
132 break; 132 break;
133 default: 133 default:
134 (void) snprintf(p, p_maxlen, 134 snprintf(p, p_maxlen,
135 "bio callback - unknown type (%d)\n", cmd); 135 "bio callback - unknown type (%d)\n", cmd);
136 break; 136 break;
137 } 137 }
diff --git a/src/lib/libcrypto/bio/bss_conn.c b/src/lib/libcrypto/bio/bss_conn.c
index fca5d5e853..45815fd696 100644
--- a/src/lib/libcrypto/bio/bss_conn.c
+++ b/src/lib/libcrypto/bio/bss_conn.c
@@ -482,7 +482,7 @@ conn_ctrl(BIO *b, int cmd, long num, void *ptr)
482 char buf[16]; 482 char buf[16];
483 unsigned char *p = ptr; 483 unsigned char *p = ptr;
484 484
485 (void) snprintf(buf, sizeof buf, "%d.%d.%d.%d", 485 snprintf(buf, sizeof buf, "%d.%d.%d.%d",
486 p[0], p[1], p[2], p[3]); 486 p[0], p[1], p[2], p[3]);
487 if (data->param_hostname != NULL) 487 if (data->param_hostname != NULL)
488 free(data->param_hostname); 488 free(data->param_hostname);
@@ -491,7 +491,7 @@ conn_ctrl(BIO *b, int cmd, long num, void *ptr)
491 } else if (num == 3) { 491 } else if (num == 3) {
492 char buf[DECIMAL_SIZE(int) + 1]; 492 char buf[DECIMAL_SIZE(int) + 1];
493 493
494 (void) snprintf(buf, sizeof buf, "%d", 494 snprintf(buf, sizeof buf, "%d",
495 *(int *)ptr); 495 *(int *)ptr);
496 if (data->param_port != NULL) 496 if (data->param_port != NULL)
497 free(data->param_port); 497 free(data->param_port);