c = os_toascii[c]; /* 'A' in ASCII */
#endif
k = 0;
- md5 = ssl_evp_md_fetch(sctx->libctx, NID_md5, sctx->propq);
- sha1 = ssl_evp_md_fetch(sctx->libctx, NID_sha1, sctx->propq);
+ md5 = EVP_MD_fetch(sctx->libctx, "MD5", sctx->propq);
+ sha1 = EVP_MD_fetch(sctx->libctx, "SHA1", sctx->propq);
m5 = EVP_MD_CTX_new();
s1 = EVP_MD_CTX_new();
if (md5 == NULL || sha1 == NULL || m5 == NULL || s1 == NULL) {
}
ctx->disabled_mac_mask = 0;
for (i = 0, t = ssl_cipher_table_mac; i < SSL_MD_NUM_IDX; i++, t++) {
- const EVP_MD *md
- = ssl_evp_md_fetch(ctx->libctx, t->nid, ctx->propq);
+ /*
+ * We ignore any errors from the fetch below. It is expected to fail
+ * if these algorithms are not available.
+ */
+ ERR_set_mark();
+ const EVP_MD *md = EVP_MD_fetch(ctx->libctx,
+ OBJ_nid2sn(t->nid),
+ ctx->propq);
+ ERR_pop_to_mark();
ctx->ssl_digest_methods[i] = md;
if (md == NULL) {
#include "internal/e_winsock.h"
#include "ssl_local.h"
+#include <openssl/err.h>
#include <openssl/objects.h>
#include <openssl/x509v3.h>
#include <openssl/rand.h>
* If these aren't available from the provider we'll get NULL returns.
* That's fine but will cause errors later if SSLv3 is negotiated
*/
- ret->md5 = ssl_evp_md_fetch(libctx, NID_md5, propq);
- ret->sha1 = ssl_evp_md_fetch(libctx, NID_sha1, propq);
+ ERR_set_mark();
+ ret->md5 = EVP_MD_fetch(libctx, "MD5", propq);
+ ret->sha1 = EVP_MD_fetch(libctx, "SHA1", propq);
+ ERR_pop_to_mark();
if ((ret->ca_names = sk_X509_NAME_new_null()) == NULL) {
ERR_raise(ERR_LIB_SSL, ERR_R_CRYPTO_LIB);
}
}
-const EVP_MD *ssl_evp_md_fetch(OSSL_LIB_CTX *libctx,
- int nid,
- const char *properties)
-{
- const EVP_MD *md;
-
- ERR_set_mark();
- md = EVP_MD_fetch(libctx, OBJ_nid2sn(nid), properties);
- ERR_pop_to_mark();
- return md;
-}
-
int ssl_evp_md_up_ref(const EVP_MD *md)
{
/* Don't up-ref an implicit EVP_MD */
const char *properties);
int ssl_evp_cipher_up_ref(const EVP_CIPHER *cipher);
void ssl_evp_cipher_free(const EVP_CIPHER *cipher);
-const EVP_MD *ssl_evp_md_fetch(OSSL_LIB_CTX *libctx,
- int nid,
- const char *properties);
int ssl_evp_md_up_ref(const EVP_MD *md);
void ssl_evp_md_free(const EVP_MD *md);
EVP_MD_CTX *hash = NULL;
unsigned int md_len;
SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
- const EVP_MD *md = ssl_evp_md_fetch(sctx->libctx, NID_id_GostR3411_2012_256,
- sctx->propq);
+ const EVP_MD *md = EVP_MD_fetch(sctx->libctx, "md_gost12_256", sctx->propq);
if (md == NULL)
return 0;