}
} else {
j = EVP_DigestVerify(mctx, data, len, hdata, hdatalen);
- if (j < 0) {
- SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, ERR_R_EVP_LIB);
- goto f_err;
- } else if (j == 0) {
+ if (j <= 0) {
al = SSL_AD_DECRYPT_ERROR;
SSLerr(SSL_F_TLS_PROCESS_CERT_VERIFY, SSL_R_BAD_SIGNATURE);
goto f_err;
&& (!s->method->ssl3_enc->change_cipher_state(s,
SSL3_CC_HANDSHAKE | SSL3_CHANGE_CIPHER_CLIENT_WRITE))) {
SSLerr(SSL_F_TLS_CONSTRUCT_FINISHED, SSL_R_CANNOT_CHANGE_CIPHER);
- goto err;
+ /*
+ * This is a fatal error, which leaves
+ * enc_write_ctx in an inconsistent state
+ * and thus ssl3_send_alert may crash.
+ */
+ return 0;
}
if (s->server) {
return 1;
}
-int ssl_cert_type(const X509 *x, const EVP_PKEY *pk)
-{
- if (pk == NULL && (pk = X509_get0_pubkey(x)) == NULL)
- return -1;
-
- switch (EVP_PKEY_id(pk)) {
- default:
- return -1;
- case EVP_PKEY_RSA:
- return SSL_PKEY_RSA;
- case EVP_PKEY_DSA:
- return SSL_PKEY_DSA_SIGN;
-#ifndef OPENSSL_NO_EC
- case EVP_PKEY_EC:
- return SSL_PKEY_ECC;
- case EVP_PKEY_ED25519:
- return SSL_PKEY_ED25519;
-#endif
-#ifndef OPENSSL_NO_GOST
- case NID_id_GostR3410_2001:
- return SSL_PKEY_GOST01;
- case NID_id_GostR3410_2012_256:
- return SSL_PKEY_GOST12_256;
- case NID_id_GostR3410_2012_512:
- return SSL_PKEY_GOST12_512;
-#endif
- }
-}
-
int ssl_verify_alarm_type(long type)
{
int al;