summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_ciph.c
diff options
context:
space:
mode:
authorbeck <>2014-04-14 18:53:14 +0000
committerbeck <>2014-04-14 18:53:14 +0000
commit715a2c58fe812af3f07885ee27a3fc208e84c5ce (patch)
tree832550e82afe0db5c3fc97737827638ec3ed0b7f /src/lib/libssl/ssl_ciph.c
parent95635d69892027aae43126c720bdf465c55b75b4 (diff)
downloadopenbsd-715a2c58fe812af3f07885ee27a3fc208e84c5ce.tar.gz
openbsd-715a2c58fe812af3f07885ee27a3fc208e84c5ce.tar.bz2
openbsd-715a2c58fe812af3f07885ee27a3fc208e84c5ce.zip
Flense all use of BIO_snprintf from ssl source - use the real one instead,
and allow for the normal posix mandated return values instead of the nonstandard one from BIO_snprintf. ok miod@
Diffstat (limited to 'src/lib/libssl/ssl_ciph.c')
-rw-r--r--src/lib/libssl/ssl_ciph.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/libssl/ssl_ciph.c b/src/lib/libssl/ssl_ciph.c
index f37c70cf91..0e24e0a5c6 100644
--- a/src/lib/libssl/ssl_ciph.c
+++ b/src/lib/libssl/ssl_ciph.c
@@ -1499,7 +1499,7 @@ const char *rule_str)
1499char 1499char
1500*SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len) 1500*SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len)
1501{ 1501{
1502 int is_export, pkl, kl; 1502 int is_export, pkl, kl, l;
1503 const char *ver, *exp_str; 1503 const char *ver, *exp_str;
1504 const char *kx, *au, *enc, *mac; 1504 const char *kx, *au, *enc, *mac;
1505 unsigned long alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl, alg2; 1505 unsigned long alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl, alg2;
@@ -1672,11 +1672,14 @@ char
1672 return("Buffer too small"); 1672 return("Buffer too small");
1673 1673
1674#ifdef KSSL_DEBUG 1674#ifdef KSSL_DEBUG
1675 BIO_snprintf(buf, len, format, cipher->name, ver, kx, au, enc, mac, exp_str, alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl); 1675 l = snprintf(buf, len, format, cipher->name, ver, kx, au, enc, mac, exp_str, alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl);
1676#else 1676#else
1677 BIO_snprintf(buf, len, format, cipher->name, ver, kx, au, enc, mac, exp_str); 1677 l = snprintf(buf, len, format, cipher->name, ver, kx, au, enc, mac, exp_str);
1678#endif /* KSSL_DEBUG */ 1678#endif /* KSSL_DEBUG */
1679 return (buf); 1679 if (l >= len || l == -1)
1680 return("Buffer too small");
1681 else
1682 return (buf);
1680} 1683}
1681 1684
1682char 1685char