-/* $OpenBSD: rsa_pmeth.c,v 1.20 2017/08/28 17:41:59 jsing Exp $ */
+/* $OpenBSD: rsa_pmeth.c,v 1.21 2018/09/05 00:55:33 djm Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
return 0;
}
- if (rslen != tbslen || memcmp(tbs, rctx->tbuf, rslen))
+ if (rslen != tbslen || timingsafe_bcmp(tbs, rctx->tbuf, rslen))
return 0;
return 1;
-/* $OpenBSD: rsa_pss.c,v 1.12 2017/01/29 17:49:23 beck Exp $ */
+/* $OpenBSD: rsa_pss.c,v 1.13 2018/09/05 00:55:33 djm Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2005.
*/
}
if (!EVP_DigestFinal_ex(&ctx, H_, NULL))
goto err;
- if (memcmp(H_, H, hLen)) {
+ if (timingsafe_bcmp(H_, H, hLen)) {
RSAerror(RSA_R_BAD_SIGNATURE);
ret = 0;
} else
-/* $OpenBSD: rsa_saos.c,v 1.23 2017/05/02 03:59:45 deraadt Exp $ */
+/* $OpenBSD: rsa_saos.c,v 1.24 2018/09/05 00:55:33 djm Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
goto err;
if ((unsigned int)sig->length != m_len ||
- memcmp(m, sig->data, m_len) != 0) {
+ timingsafe_bcmp(m, sig->data, m_len) != 0) {
RSAerror(RSA_R_BAD_SIGNATURE);
} else
ret = 1;
-/* $OpenBSD: rsa_sign.c,v 1.30 2018/07/23 17:37:17 tb Exp $ */
+/* $OpenBSD: rsa_sign.c,v 1.31 2018/09/05 00:55:33 djm Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
RSAerror(RSA_R_INVALID_MESSAGE_LENGTH);
goto err;
}
- if (memcmp(decrypt_buf, m, SSL_SIG_LENGTH) != 0) {
+ if (timingsafe_bcmp(decrypt_buf,
+ m, SSL_SIG_LENGTH) != 0) {
RSAerror(RSA_R_BAD_SIGNATURE);
goto err;
}
goto err;
if (encoded_len != decrypt_len ||
- memcmp(encoded, decrypt_buf, encoded_len) != 0) {
+ timingsafe_bcmp(encoded, decrypt_buf, encoded_len) != 0) {
RSAerror(RSA_R_BAD_SIGNATURE);
goto err;
}