A local copy of OpenSSL from GitHub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.1 KiB

  1. /*
  2. * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the OpenSSL license (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 <openssl/err.h>
  11. #include <openssl/ui.h>
  12. /* BEGIN ERROR CODES */
  13. #ifndef OPENSSL_NO_ERR
  14. # define ERR_FUNC(func) ERR_PACK(ERR_LIB_UI,func,0)
  15. # define ERR_REASON(reason) ERR_PACK(ERR_LIB_UI,0,reason)
  16. static ERR_STRING_DATA UI_str_functs[] = {
  17. {ERR_FUNC(UI_F_GENERAL_ALLOCATE_BOOLEAN), "general_allocate_boolean"},
  18. {ERR_FUNC(UI_F_GENERAL_ALLOCATE_PROMPT), "general_allocate_prompt"},
  19. {ERR_FUNC(UI_F_GENERAL_ALLOCATE_STRING), "GENERAL_ALLOCATE_STRING"},
  20. {ERR_FUNC(UI_F_UI_CREATE_METHOD), "UI_create_method"},
  21. {ERR_FUNC(UI_F_UI_CTRL), "UI_ctrl"},
  22. {ERR_FUNC(UI_F_UI_DUP_ERROR_STRING), "UI_dup_error_string"},
  23. {ERR_FUNC(UI_F_UI_DUP_INFO_STRING), "UI_dup_info_string"},
  24. {ERR_FUNC(UI_F_UI_DUP_INPUT_BOOLEAN), "UI_dup_input_boolean"},
  25. {ERR_FUNC(UI_F_UI_DUP_INPUT_STRING), "UI_dup_input_string"},
  26. {ERR_FUNC(UI_F_UI_DUP_VERIFY_STRING), "UI_dup_verify_string"},
  27. {ERR_FUNC(UI_F_UI_GET0_RESULT), "UI_get0_result"},
  28. {ERR_FUNC(UI_F_UI_NEW_METHOD), "UI_new_method"},
  29. {ERR_FUNC(UI_F_UI_SET_RESULT), "UI_set_result"},
  30. {0, NULL}
  31. };
  32. static ERR_STRING_DATA UI_str_reasons[] = {
  33. {ERR_REASON(UI_R_COMMON_OK_AND_CANCEL_CHARACTERS),
  34. "common ok and cancel characters"},
  35. {ERR_REASON(UI_R_INDEX_TOO_LARGE), "index too large"},
  36. {ERR_REASON(UI_R_INDEX_TOO_SMALL), "index too small"},
  37. {ERR_REASON(UI_R_NO_RESULT_BUFFER), "no result buffer"},
  38. {ERR_REASON(UI_R_RESULT_TOO_LARGE), "result too large"},
  39. {ERR_REASON(UI_R_RESULT_TOO_SMALL), "result too small"},
  40. {ERR_REASON(UI_R_UNKNOWN_CONTROL_COMMAND), "unknown control command"},
  41. {0, NULL}
  42. };
  43. #endif
  44. void ERR_load_UI_strings(void)
  45. {
  46. #ifndef OPENSSL_NO_ERR
  47. if (ERR_func_error_string(UI_str_functs[0].error) == NULL) {
  48. ERR_load_strings(0, UI_str_functs);
  49. ERR_load_strings(0, UI_str_reasons);
  50. }
  51. #endif
  52. }