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.

195 lines
9.9 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. /*
  10. * NOTE: this file was auto generated by the mkerr.pl script: any changes
  11. * made to it will be overwritten when the script next updates this file,
  12. * only reason strings will be preserved.
  13. */
  14. #include <stdio.h>
  15. #include <openssl/err.h>
  16. #include <openssl/rsa.h>
  17. /* BEGIN ERROR CODES */
  18. #ifndef OPENSSL_NO_ERR
  19. # define ERR_FUNC(func) ERR_PACK(ERR_LIB_RSA,func,0)
  20. # define ERR_REASON(reason) ERR_PACK(ERR_LIB_RSA,0,reason)
  21. static ERR_STRING_DATA RSA_str_functs[] = {
  22. {ERR_FUNC(RSA_F_CHECK_PADDING_MD), "check_padding_md"},
  23. {ERR_FUNC(RSA_F_DO_RSA_PRINT), "do_rsa_print"},
  24. {ERR_FUNC(RSA_F_FIPS_RSA_SIGN_DIGEST), "FIPS_rsa_sign_digest"},
  25. {ERR_FUNC(RSA_F_FIPS_RSA_VERIFY), "FIPS_rsa_verify"},
  26. {ERR_FUNC(RSA_F_FIPS_RSA_VERIFY_DIGEST), "FIPS_rsa_verify_digest"},
  27. {ERR_FUNC(RSA_F_INT_RSA_VERIFY), "int_rsa_verify"},
  28. {ERR_FUNC(RSA_F_MEMORY_LOCK), "MEMORY_LOCK"},
  29. {ERR_FUNC(RSA_F_OLD_RSA_PRIV_DECODE), "old_rsa_priv_decode"},
  30. {ERR_FUNC(RSA_F_PKEY_RSA_CTRL), "pkey_rsa_ctrl"},
  31. {ERR_FUNC(RSA_F_PKEY_RSA_CTRL_STR), "pkey_rsa_ctrl_str"},
  32. {ERR_FUNC(RSA_F_PKEY_RSA_SIGN), "pkey_rsa_sign"},
  33. {ERR_FUNC(RSA_F_PKEY_RSA_VERIFYRECOVER), "pkey_rsa_verifyrecover"},
  34. {ERR_FUNC(RSA_F_RSA_ALGOR_TO_MD), "rsa_algor_to_md"},
  35. {ERR_FUNC(RSA_F_RSA_BUILTIN_KEYGEN), "rsa_builtin_keygen"},
  36. {ERR_FUNC(RSA_F_RSA_CHECK_KEY), "RSA_check_key"},
  37. {ERR_FUNC(RSA_F_RSA_CHECK_KEY_EX), "RSA_check_key_ex"},
  38. {ERR_FUNC(RSA_F_RSA_CMS_DECRYPT), "rsa_cms_decrypt"},
  39. {ERR_FUNC(RSA_F_RSA_GENERATE_KEY), "RSA_generate_key"},
  40. {ERR_FUNC(RSA_F_RSA_ITEM_VERIFY), "rsa_item_verify"},
  41. {ERR_FUNC(RSA_F_RSA_MEMORY_LOCK), "RSA_memory_lock"},
  42. {ERR_FUNC(RSA_F_RSA_METH_DUP), "RSA_meth_dup"},
  43. {ERR_FUNC(RSA_F_RSA_METH_NEW), "RSA_meth_new"},
  44. {ERR_FUNC(RSA_F_RSA_METH_SET1_NAME), "RSA_meth_set1_name"},
  45. {ERR_FUNC(RSA_F_RSA_MGF1_TO_MD), "rsa_mgf1_to_md"},
  46. {ERR_FUNC(RSA_F_RSA_NEW_METHOD), "RSA_new_method"},
  47. {ERR_FUNC(RSA_F_RSA_NULL), "RSA_NULL"},
  48. {ERR_FUNC(RSA_F_RSA_NULL_MOD_EXP), "RSA_NULL_MOD_EXP"},
  49. {ERR_FUNC(RSA_F_RSA_NULL_PRIVATE_DECRYPT), "RSA_null_private_decrypt"},
  50. {ERR_FUNC(RSA_F_RSA_NULL_PRIVATE_ENCRYPT), "RSA_null_private_encrypt"},
  51. {ERR_FUNC(RSA_F_RSA_NULL_PUBLIC_DECRYPT), "RSA_null_public_decrypt"},
  52. {ERR_FUNC(RSA_F_RSA_NULL_PUBLIC_ENCRYPT), "RSA_null_public_encrypt"},
  53. {ERR_FUNC(RSA_F_RSA_OAEP_TO_CTX), "RSA_OAEP_TO_CTX"},
  54. {ERR_FUNC(RSA_F_RSA_OSSL_PRIVATE_DECRYPT), "rsa_ossl_private_decrypt"},
  55. {ERR_FUNC(RSA_F_RSA_OSSL_PRIVATE_ENCRYPT), "rsa_ossl_private_encrypt"},
  56. {ERR_FUNC(RSA_F_RSA_OSSL_PUBLIC_DECRYPT), "rsa_ossl_public_decrypt"},
  57. {ERR_FUNC(RSA_F_RSA_OSSL_PUBLIC_ENCRYPT), "rsa_ossl_public_encrypt"},
  58. {ERR_FUNC(RSA_F_RSA_PADDING_ADD_NONE), "RSA_padding_add_none"},
  59. {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP), "RSA_padding_add_PKCS1_OAEP"},
  60. {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_OAEP_MGF1),
  61. "RSA_padding_add_PKCS1_OAEP_mgf1"},
  62. {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_PSS), "RSA_padding_add_PKCS1_PSS"},
  63. {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1),
  64. "RSA_padding_add_PKCS1_PSS_mgf1"},
  65. {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1),
  66. "RSA_padding_add_PKCS1_type_1"},
  67. {ERR_FUNC(RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2),
  68. "RSA_padding_add_PKCS1_type_2"},
  69. {ERR_FUNC(RSA_F_RSA_PADDING_ADD_SSLV23), "RSA_padding_add_SSLv23"},
  70. {ERR_FUNC(RSA_F_RSA_PADDING_ADD_X931), "RSA_padding_add_X931"},
  71. {ERR_FUNC(RSA_F_RSA_PADDING_CHECK_NONE), "RSA_padding_check_none"},
  72. {ERR_FUNC(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP),
  73. "RSA_padding_check_PKCS1_OAEP"},
  74. {ERR_FUNC(RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1),
  75. "RSA_padding_check_PKCS1_OAEP_mgf1"},
  76. {ERR_FUNC(RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1),
  77. "RSA_padding_check_PKCS1_type_1"},
  78. {ERR_FUNC(RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2),
  79. "RSA_padding_check_PKCS1_type_2"},
  80. {ERR_FUNC(RSA_F_RSA_PADDING_CHECK_SSLV23), "RSA_padding_check_SSLv23"},
  81. {ERR_FUNC(RSA_F_RSA_PADDING_CHECK_X931), "RSA_padding_check_X931"},
  82. {ERR_FUNC(RSA_F_RSA_PRINT), "RSA_print"},
  83. {ERR_FUNC(RSA_F_RSA_PRINT_FP), "RSA_print_fp"},
  84. {ERR_FUNC(RSA_F_RSA_PRIV_DECODE), "RSA_PRIV_DECODE"},
  85. {ERR_FUNC(RSA_F_RSA_PRIV_ENCODE), "rsa_priv_encode"},
  86. {ERR_FUNC(RSA_F_RSA_PSS_TO_CTX), "rsa_pss_to_ctx"},
  87. {ERR_FUNC(RSA_F_RSA_PUB_DECODE), "rsa_pub_decode"},
  88. {ERR_FUNC(RSA_F_RSA_SETUP_BLINDING), "RSA_setup_blinding"},
  89. {ERR_FUNC(RSA_F_RSA_SIGN), "RSA_sign"},
  90. {ERR_FUNC(RSA_F_RSA_SIGN_ASN1_OCTET_STRING), "RSA_sign_ASN1_OCTET_STRING"},
  91. {ERR_FUNC(RSA_F_RSA_VERIFY), "RSA_verify"},
  92. {ERR_FUNC(RSA_F_RSA_VERIFY_ASN1_OCTET_STRING),
  93. "RSA_verify_ASN1_OCTET_STRING"},
  94. {ERR_FUNC(RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1), "RSA_verify_PKCS1_PSS_mgf1"},
  95. {0, NULL}
  96. };
  97. static ERR_STRING_DATA RSA_str_reasons[] = {
  98. {ERR_REASON(RSA_R_ALGORITHM_MISMATCH), "algorithm mismatch"},
  99. {ERR_REASON(RSA_R_BAD_E_VALUE), "bad e value"},
  100. {ERR_REASON(RSA_R_BAD_FIXED_HEADER_DECRYPT), "bad fixed header decrypt"},
  101. {ERR_REASON(RSA_R_BAD_PAD_BYTE_COUNT), "bad pad byte count"},
  102. {ERR_REASON(RSA_R_BAD_SIGNATURE), "bad signature"},
  103. {ERR_REASON(RSA_R_BLOCK_TYPE_IS_NOT_01), "block type is not 01"},
  104. {ERR_REASON(RSA_R_BLOCK_TYPE_IS_NOT_02), "block type is not 02"},
  105. {ERR_REASON(RSA_R_DATA_GREATER_THAN_MOD_LEN), "data greater than mod len"},
  106. {ERR_REASON(RSA_R_DATA_TOO_LARGE), "data too large"},
  107. {ERR_REASON(RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE),
  108. "data too large for key size"},
  109. {ERR_REASON(RSA_R_DATA_TOO_LARGE_FOR_MODULUS),
  110. "data too large for modulus"},
  111. {ERR_REASON(RSA_R_DATA_TOO_SMALL), "data too small"},
  112. {ERR_REASON(RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE),
  113. "data too small for key size"},
  114. {ERR_REASON(RSA_R_DIGEST_DOES_NOT_MATCH), "digest does not match"},
  115. {ERR_REASON(RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY),
  116. "digest too big for rsa key"},
  117. {ERR_REASON(RSA_R_DMP1_NOT_CONGRUENT_TO_D), "dmp1 not congruent to d"},
  118. {ERR_REASON(RSA_R_DMQ1_NOT_CONGRUENT_TO_D), "dmq1 not congruent to d"},
  119. {ERR_REASON(RSA_R_D_E_NOT_CONGRUENT_TO_1), "d e not congruent to 1"},
  120. {ERR_REASON(RSA_R_FIRST_OCTET_INVALID), "first octet invalid"},
  121. {ERR_REASON(RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE),
  122. "illegal or unsupported padding mode"},
  123. {ERR_REASON(RSA_R_INVALID_DIGEST), "invalid digest"},
  124. {ERR_REASON(RSA_R_INVALID_DIGEST_LENGTH), "invalid digest length"},
  125. {ERR_REASON(RSA_R_INVALID_HEADER), "invalid header"},
  126. {ERR_REASON(RSA_R_INVALID_KEYBITS), "invalid keybits"},
  127. {ERR_REASON(RSA_R_INVALID_LABEL), "invalid label"},
  128. {ERR_REASON(RSA_R_INVALID_MESSAGE_LENGTH), "invalid message length"},
  129. {ERR_REASON(RSA_R_INVALID_MGF1_MD), "invalid mgf1 md"},
  130. {ERR_REASON(RSA_R_INVALID_OAEP_PARAMETERS), "invalid oaep parameters"},
  131. {ERR_REASON(RSA_R_INVALID_PADDING), "invalid padding"},
  132. {ERR_REASON(RSA_R_INVALID_PADDING_MODE), "invalid padding mode"},
  133. {ERR_REASON(RSA_R_INVALID_PSS_PARAMETERS), "invalid pss parameters"},
  134. {ERR_REASON(RSA_R_INVALID_PSS_SALTLEN), "invalid pss saltlen"},
  135. {ERR_REASON(RSA_R_INVALID_SALT_LENGTH), "invalid salt length"},
  136. {ERR_REASON(RSA_R_INVALID_TRAILER), "invalid trailer"},
  137. {ERR_REASON(RSA_R_INVALID_X931_DIGEST), "invalid x931 digest"},
  138. {ERR_REASON(RSA_R_IQMP_NOT_INVERSE_OF_Q), "iqmp not inverse of q"},
  139. {ERR_REASON(RSA_R_KEY_SIZE_TOO_SMALL), "key size too small"},
  140. {ERR_REASON(RSA_R_LAST_OCTET_INVALID), "last octet invalid"},
  141. {ERR_REASON(RSA_R_MODULUS_TOO_LARGE), "modulus too large"},
  142. {ERR_REASON(RSA_R_NO_PUBLIC_EXPONENT), "no public exponent"},
  143. {ERR_REASON(RSA_R_NULL_BEFORE_BLOCK_MISSING), "null before block missing"},
  144. {ERR_REASON(RSA_R_N_DOES_NOT_EQUAL_P_Q), "n does not equal p q"},
  145. {ERR_REASON(RSA_R_OAEP_DECODING_ERROR), "oaep decoding error"},
  146. {ERR_REASON(RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE),
  147. "operation not supported for this keytype"},
  148. {ERR_REASON(RSA_R_PADDING_CHECK_FAILED), "padding check failed"},
  149. {ERR_REASON(RSA_R_PKCS_DECODING_ERROR), "pkcs decoding error"},
  150. {ERR_REASON(RSA_R_P_NOT_PRIME), "p not prime"},
  151. {ERR_REASON(RSA_R_Q_NOT_PRIME), "q not prime"},
  152. {ERR_REASON(RSA_R_RSA_OPERATIONS_NOT_SUPPORTED),
  153. "rsa operations not supported"},
  154. {ERR_REASON(RSA_R_SLEN_CHECK_FAILED), "salt length check failed"},
  155. {ERR_REASON(RSA_R_SLEN_RECOVERY_FAILED), "salt length recovery failed"},
  156. {ERR_REASON(RSA_R_SSLV3_ROLLBACK_ATTACK), "sslv3 rollback attack"},
  157. {ERR_REASON(RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD),
  158. "the asn1 object identifier is not known for this md"},
  159. {ERR_REASON(RSA_R_UNKNOWN_ALGORITHM_TYPE), "unknown algorithm type"},
  160. {ERR_REASON(RSA_R_UNKNOWN_DIGEST), "unknown digest"},
  161. {ERR_REASON(RSA_R_UNKNOWN_MASK_DIGEST), "unknown mask digest"},
  162. {ERR_REASON(RSA_R_UNKNOWN_PADDING_TYPE), "unknown padding type"},
  163. {ERR_REASON(RSA_R_UNKNOWN_PSS_DIGEST), "unknown pss digest"},
  164. {ERR_REASON(RSA_R_UNSUPPORTED_ENCRYPTION_TYPE),
  165. "unsupported encryption type"},
  166. {ERR_REASON(RSA_R_UNSUPPORTED_LABEL_SOURCE), "unsupported label source"},
  167. {ERR_REASON(RSA_R_UNSUPPORTED_MASK_ALGORITHM),
  168. "unsupported mask algorithm"},
  169. {ERR_REASON(RSA_R_UNSUPPORTED_MASK_PARAMETER),
  170. "unsupported mask parameter"},
  171. {ERR_REASON(RSA_R_UNSUPPORTED_SIGNATURE_TYPE),
  172. "unsupported signature type"},
  173. {ERR_REASON(RSA_R_VALUE_MISSING), "value missing"},
  174. {ERR_REASON(RSA_R_WRONG_SIGNATURE_LENGTH), "wrong signature length"},
  175. {0, NULL}
  176. };
  177. #endif
  178. void ERR_load_RSA_strings(void)
  179. {
  180. #ifndef OPENSSL_NO_ERR
  181. if (ERR_func_error_string(RSA_str_functs[0].error) == NULL) {
  182. ERR_load_strings(0, RSA_str_functs);
  183. ERR_load_strings(0, RSA_str_reasons);
  184. }
  185. #endif
  186. }