diff options
author | 2014-04-14 18:53:14 +0000 | |
---|---|---|
committer | 2014-04-14 18:53:14 +0000 | |
commit | bcf91d2ddffe6515f8fae0a0d9ab1c6787ab43ad (patch) | |
tree | e733f4f136a08eb34c6a7cc50ffa822a1199a765 /lib/libssl/ssl_ciph.c | |
parent | make OPENSSL_NO_HEARTBLEED the default and only option. ok deraadt miod (diff) | |
download | wireguard-openbsd-bcf91d2ddffe6515f8fae0a0d9ab1c6787ab43ad.tar.xz wireguard-openbsd-bcf91d2ddffe6515f8fae0a0d9ab1c6787ab43ad.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 'lib/libssl/ssl_ciph.c')
-rw-r--r-- | lib/libssl/ssl_ciph.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libssl/ssl_ciph.c b/lib/libssl/ssl_ciph.c index f37c70cf915..0e24e0a5c69 100644 --- a/lib/libssl/ssl_ciph.c +++ b/lib/libssl/ssl_ciph.c @@ -1499,7 +1499,7 @@ const char *rule_str) char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len) { - int is_export, pkl, kl; + int is_export, pkl, kl, l; const char *ver, *exp_str; const char *kx, *au, *enc, *mac; unsigned long alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl, alg2; @@ -1672,11 +1672,14 @@ char return("Buffer too small"); #ifdef KSSL_DEBUG - BIO_snprintf(buf, len, format, cipher->name, ver, kx, au, enc, mac, exp_str, alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl); + l = snprintf(buf, len, format, cipher->name, ver, kx, au, enc, mac, exp_str, alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl); #else - BIO_snprintf(buf, len, format, cipher->name, ver, kx, au, enc, mac, exp_str); + l = snprintf(buf, len, format, cipher->name, ver, kx, au, enc, mac, exp_str); #endif /* KSSL_DEBUG */ - return (buf); + if (l >= len || l == -1) + return("Buffer too small"); + else + return (buf); } char |