forked from openssl/openssl
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
evp_get_digest/cipherbyname_ex(): Try to fetch if not found
If the name is not found in namemap, we need to try to fetch the algorithm and query the namemap again. Fixes openssl#19338 Reviewed-by: Neil Horman <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Shane Lontis <[email protected]> (Merged from openssl#24940) (cherry picked from commit 454ca90)
- Loading branch information
Showing
4 changed files
with
91 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2024 The OpenSSL Project Authors. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License 2.0 (the "License"). You may not use | ||
* this file except in compliance with the License. You can obtain a copy | ||
* in the file LICENSE in the source distribution or at | ||
* https://www.openssl.org/source/license.html | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
#include <openssl/evp.h> | ||
#include "testutil.h" | ||
|
||
static int test_evp_get_digestbyname(void) | ||
{ | ||
const EVP_MD *md; | ||
|
||
if (!TEST_ptr(md = EVP_get_digestbyname("SHA2-256"))) | ||
return 0; | ||
return 1; | ||
} | ||
|
||
static int test_evp_get_cipherbyname(void) | ||
{ | ||
const EVP_CIPHER *cipher; | ||
|
||
if (!TEST_ptr(cipher = EVP_get_cipherbyname("AES-256-WRAP"))) | ||
return 0; | ||
return 1; | ||
} | ||
|
||
int setup_tests(void) | ||
{ | ||
ADD_TEST(test_evp_get_digestbyname); | ||
ADD_TEST(test_evp_get_cipherbyname); | ||
return 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#! /usr/bin/env perl | ||
# Copyright 2024 The OpenSSL Project Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License 2.0 (the "License"). You may not use | ||
# this file except in compliance with the License. You can obtain a copy | ||
# in the file LICENSE in the source distribution or at | ||
# https://www.openssl.org/source/license.html | ||
|
||
use strict; | ||
use OpenSSL::Test; | ||
use OpenSSL::Test::Simple; | ||
use OpenSSL::Test::Utils; | ||
|
||
setup("test_evp_byname"); | ||
|
||
simple_test("test_evp_byname", "evp_byname_test"); |