diff options
author | 2017-01-29 17:49:22 +0000 | |
---|---|---|
committer | 2017-01-29 17:49:22 +0000 | |
commit | 5067ae9f807f8af9e6350e51e6a54619386c06ba (patch) | |
tree | f2455d670f0ea5c04a6e9cbdf4d8ef0d4ff40c47 /lib/libcrypto/rsa/rsa_ssl.c | |
parent | Ensure the build user can write to the GLOBAL_AUTOCONF_CACHE file by (diff) | |
download | wireguard-openbsd-5067ae9f807f8af9e6350e51e6a54619386c06ba.tar.xz wireguard-openbsd-5067ae9f807f8af9e6350e51e6a54619386c06ba.zip |
Send the function codes from the error functions to the bit bucket,
as was done earlier in libssl. Thanks inoguchi@ for noticing
libssl had more reacharounds into this.
ok jsing@ inoguchi@
Diffstat (limited to 'lib/libcrypto/rsa/rsa_ssl.c')
-rw-r--r-- | lib/libcrypto/rsa/rsa_ssl.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/libcrypto/rsa/rsa_ssl.c b/lib/libcrypto/rsa/rsa_ssl.c index 73262f29c16..60fc8ec94f8 100644 --- a/lib/libcrypto/rsa/rsa_ssl.c +++ b/lib/libcrypto/rsa/rsa_ssl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_ssl.c,v 1.14 2014/10/22 13:02:04 jsing Exp $ */ +/* $OpenBSD: rsa_ssl.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -72,8 +72,7 @@ RSA_padding_add_SSLv23(unsigned char *to, int tlen, const unsigned char *from, unsigned char *p; if (flen > tlen - 11) { - RSAerr(RSA_F_RSA_PADDING_ADD_SSLV23, - RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); + RSAerror(RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); return 0; } @@ -109,12 +108,11 @@ RSA_padding_check_SSLv23(unsigned char *to, int tlen, const unsigned char *from, p = from; if (flen < 10) { - RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23, RSA_R_DATA_TOO_SMALL); + RSAerror(RSA_R_DATA_TOO_SMALL); return -1; } if (num != flen + 1 || *(p++) != 02) { - RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23, - RSA_R_BLOCK_TYPE_IS_NOT_02); + RSAerror(RSA_R_BLOCK_TYPE_IS_NOT_02); return -1; } @@ -125,8 +123,7 @@ RSA_padding_check_SSLv23(unsigned char *to, int tlen, const unsigned char *from, break; if (i == j || i < 8) { - RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23, - RSA_R_NULL_BEFORE_BLOCK_MISSING); + RSAerror(RSA_R_NULL_BEFORE_BLOCK_MISSING); return -1; } for (k = -9; k < -1; k++) { @@ -134,15 +131,14 @@ RSA_padding_check_SSLv23(unsigned char *to, int tlen, const unsigned char *from, break; } if (k == -1) { - RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23, - RSA_R_SSLV3_ROLLBACK_ATTACK); + RSAerror(RSA_R_SSLV3_ROLLBACK_ATTACK); return -1; } i++; /* Skip over the '\0' */ j -= i; if (j > tlen) { - RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23, RSA_R_DATA_TOO_LARGE); + RSAerror(RSA_R_DATA_TOO_LARGE); return -1; } memcpy(to, p, j); |