diff options
author | jca <> | 2024-03-24 14:00:11 +0000 |
---|---|---|
committer | jca <> | 2024-03-24 14:00:11 +0000 |
commit | d47012866b2cc0e1cc1e9e575bc8f24724d0471a (patch) | |
tree | 92d648ed11868852f0edae43a4255c39b85041ec /src/regress/lib/libcrypto/evp/evp_test.c | |
parent | 471080a8a794fa50624c5623e942762c8f568874 (diff) | |
download | openbsd-d47012866b2cc0e1cc1e9e575bc8f24724d0471a.tar.gz openbsd-d47012866b2cc0e1cc1e9e575bc8f24724d0471a.tar.bz2 openbsd-d47012866b2cc0e1cc1e9e575bc8f24724d0471a.zip |
Add tests for EVP_get_cipherbyname(NULL) and EVP_get_digestbyname(NULL)
Requested by and ok tb@
Diffstat (limited to 'src/regress/lib/libcrypto/evp/evp_test.c')
-rw-r--r-- | src/regress/lib/libcrypto/evp/evp_test.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/regress/lib/libcrypto/evp/evp_test.c b/src/regress/lib/libcrypto/evp/evp_test.c index e7ef804ed0..eebbd50b0c 100644 --- a/src/regress/lib/libcrypto/evp/evp_test.c +++ b/src/regress/lib/libcrypto/evp/evp_test.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: evp_test.c,v 1.17 2024/02/29 20:02:40 tb Exp $ */ | 1 | /* $OpenBSD: evp_test.c,v 1.18 2024/03/24 14:00:11 jca Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2022 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2022 Joel Sing <jsing@openbsd.org> |
4 | * Copyright (c) 2023 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2023 Theo Buehler <tb@openbsd.org> |
@@ -737,6 +737,28 @@ obj_name_do_all_test(void) | |||
737 | return failure; | 737 | return failure; |
738 | } | 738 | } |
739 | 739 | ||
740 | static int | ||
741 | evp_get_cipherbyname_test(void) | ||
742 | { | ||
743 | int failure = 0; | ||
744 | |||
745 | /* Should handle NULL gracefully */ | ||
746 | failure |= EVP_get_cipherbyname(NULL) != NULL; | ||
747 | |||
748 | return failure; | ||
749 | } | ||
750 | |||
751 | static int | ||
752 | evp_get_digestbyname_test(void) | ||
753 | { | ||
754 | int failure = 0; | ||
755 | |||
756 | /* Should handle NULL gracefully */ | ||
757 | failure |= EVP_get_digestbyname(NULL) != NULL; | ||
758 | |||
759 | return failure; | ||
760 | } | ||
761 | |||
740 | int | 762 | int |
741 | main(int argc, char **argv) | 763 | main(int argc, char **argv) |
742 | { | 764 | { |
@@ -748,6 +770,8 @@ main(int argc, char **argv) | |||
748 | failed |= evp_do_all_test(); | 770 | failed |= evp_do_all_test(); |
749 | failed |= evp_aliases_test(); | 771 | failed |= evp_aliases_test(); |
750 | failed |= obj_name_do_all_test(); | 772 | failed |= obj_name_do_all_test(); |
773 | failed |= evp_get_cipherbyname_test(); | ||
774 | failed |= evp_get_digestbyname_test(); | ||
751 | 775 | ||
752 | OPENSSL_cleanup(); | 776 | OPENSSL_cleanup(); |
753 | 777 | ||