cmp_err.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
  3. * Copyright Nokia 2007-2019
  4. * Copyright Siemens AG 2015-2019
  5. *
  6. * Licensed under the Apache License 2.0 (the "License"). You may not use
  7. * this file except in compliance with the License. You can obtain a copy
  8. * in the file LICENSE in the source distribution or at
  9. * https://www.openssl.org/source/license.html
  10. */
  11. #include <openssl/err.h>
  12. #include <openssl/cmperr.h>
  13. #ifndef OPENSSL_NO_ERR
  14. static const ERR_STRING_DATA CMP_str_reasons[] = {
  15. {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_ERROR_PARSING_PKISTATUS),
  16. "error parsing pkistatus"},
  17. {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_FAILURE_OBTAINING_RANDOM),
  18. "failure obtaining random"},
  19. {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_INVALID_ARGS), "invalid args"},
  20. {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MULTIPLE_SAN_SOURCES),
  21. "multiple san sources"},
  22. {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_MISSING_SENDER_IDENTIFICATION),
  23. "missing sender identification"},
  24. {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_NO_STDIO), "no stdio"},
  25. {ERR_PACK(ERR_LIB_CMP, 0, CMP_R_NULL_ARGUMENT), "null argument"},
  26. {0, NULL}
  27. };
  28. #endif
  29. int ERR_load_CMP_strings(void)
  30. {
  31. #ifndef OPENSSL_NO_ERR
  32. if (ERR_reason_error_string(CMP_str_reasons[0].error) == NULL)
  33. ERR_load_strings_const(CMP_str_reasons);
  34. #endif
  35. return 1;
  36. }