-/* $OpenBSD: ssl_clnt.c,v 1.158 2022/12/26 07:31:44 jmc Exp $ */
+/* $OpenBSD: ssl_clnt.c,v 1.159 2023/06/11 18:50:51 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
SSLerror(s, ERR_R_EVP_LIB);
goto err;
}
- if (!EVP_DigestSignUpdate(mctx, hdata, hdata_len)) {
- SSLerror(s, ERR_R_EVP_LIB);
- goto err;
- }
- if (!EVP_DigestSignFinal(mctx, NULL, &signature_len) ||
- signature_len == 0) {
+ if (!EVP_DigestSign(mctx, NULL, &signature_len, hdata, hdata_len)) {
SSLerror(s, ERR_R_EVP_LIB);
goto err;
}
SSLerror(s, ERR_R_MALLOC_FAILURE);
goto err;
}
- if (!EVP_DigestSignFinal(mctx, signature, &signature_len)) {
+ if (!EVP_DigestSign(mctx, signature, &signature_len, hdata, hdata_len)) {
SSLerror(s, ERR_R_EVP_LIB);
goto err;
}
SSLerror(s, ERR_R_EVP_LIB);
goto err;
}
- if (!EVP_DigestSignUpdate(mctx, hdata, hdata_len)) {
- SSLerror(s, ERR_R_EVP_LIB);
- goto err;
- }
- if (!EVP_DigestSignFinal(mctx, NULL, &signature_len) ||
- signature_len == 0) {
+ if (!EVP_DigestSign(mctx, NULL, &signature_len, hdata, hdata_len)) {
SSLerror(s, ERR_R_EVP_LIB);
goto err;
}
SSLerror(s, ERR_R_MALLOC_FAILURE);
goto err;
}
- if (!EVP_DigestSignFinal(mctx, signature, &signature_len)) {
+ if (!EVP_DigestSign(mctx, signature, &signature_len, hdata, hdata_len)) {
SSLerror(s, ERR_R_EVP_LIB);
goto err;
}
-/* $OpenBSD: ssl_srvr.c,v 1.153 2022/12/26 07:31:44 jmc Exp $ */
+/* $OpenBSD: ssl_srvr.c,v 1.154 2023/06/11 18:50:51 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
al = SSL_AD_INTERNAL_ERROR;
goto fatal_err;
}
- if (!EVP_DigestVerifyUpdate(mctx, hdata, hdatalen)) {
+ if (EVP_DigestVerify(mctx, CBS_data(&signature),
+ CBS_len(&signature), hdata, hdatalen) <= 0) {
SSLerror(s, ERR_R_EVP_LIB);
al = SSL_AD_INTERNAL_ERROR;
goto fatal_err;
}
- if (EVP_DigestVerifyFinal(mctx, CBS_data(&signature),
- CBS_len(&signature)) <= 0) {
- al = SSL_AD_DECRYPT_ERROR;
- SSLerror(s, SSL_R_BAD_SIGNATURE);
- goto fatal_err;
- }
} else if (EVP_PKEY_id(pkey) == EVP_PKEY_RSA) {
RSA *rsa;