evp_byname_test.c 900 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <string.h>
  12. #include <openssl/evp.h>
  13. #include "testutil.h"
  14. static int test_evp_get_digestbyname(void)
  15. {
  16. const EVP_MD *md;
  17. if (!TEST_ptr(md = EVP_get_digestbyname("SHA2-256")))
  18. return 0;
  19. return 1;
  20. }
  21. static int test_evp_get_cipherbyname(void)
  22. {
  23. const EVP_CIPHER *cipher;
  24. if (!TEST_ptr(cipher = EVP_get_cipherbyname("AES-256-WRAP")))
  25. return 0;
  26. return 1;
  27. }
  28. int setup_tests(void)
  29. {
  30. ADD_TEST(test_evp_get_digestbyname);
  31. ADD_TEST(test_evp_get_cipherbyname);
  32. return 1;
  33. }