Fix remaining error code discrepancies.
authorDr. Stephen Henson <steve@openssl.org>
Tue, 14 Aug 2007 16:00:52 +0000 (16:00 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 14 Aug 2007 16:00:52 +0000 (16:00 +0000)
14 files changed:
crypto/err/err_str.c
crypto/evp/dig_eng.c
crypto/evp/digest.c
crypto/evp/enc_min.c
crypto/evp/evp.h
crypto/evp/evp_enc.c
crypto/evp/evp_err.c
crypto/rand/rand.h
crypto/rand/rand_eng.c
crypto/rand/rand_err.c
crypto/rand/rand_lib.c
crypto/rsa/rsa.h
crypto/rsa/rsa_eng.c
crypto/rsa/rsa_err.c

index bc448e647f7b871df0f1ddafbb49cc494bd4de39..4c7807398f18ba04f337fd245b573e0fed88bbf0 100644 (file)
@@ -223,7 +223,7 @@ static ERR_STRING_DATA SYS_str_reasons[NUM_SYS_STR_REASONS + 1];
  * others will be displayed numerically by ERR_error_string.
  * It is crucial that we have something for each reason code
  * that occurs in ERR_str_reasons, or bogus reason strings
- * will be returned for SYSerr(), which always gets an errno
+ * will be returned for SYSerr, which always gets an errno
  * value and never one of those 'standard' reason codes. */
 
 static void build_SYS_str_reasons(void)
index 159b2f7c3cd0d4fe2117bcb773762f3a30dae132..64cdf9366c9ce7517a0409dffbcafdf4a2264fe1 100644 (file)
@@ -135,7 +135,7 @@ static int do_evp_md_engine_full(EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *
                        {
                        if (!ENGINE_init(impl))
                                {
-                               EVPerr(EVP_F_EVP_DIGESTINIT_EX,EVP_R_INITIALIZATION_ERROR);
+                               EVPerr(EVP_F_DO_EVP_MD_ENGINE_FULL,EVP_R_INITIALIZATION_ERROR);
                                return 0;
                                }
                        }
@@ -149,7 +149,7 @@ static int do_evp_md_engine_full(EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *
                        if(!d)
                                {
                                /* Same comment from evp_enc.c */
-                               EVPerr(EVP_F_EVP_DIGESTINIT_EX,EVP_R_INITIALIZATION_ERROR);
+                               EVPerr(EVP_F_DO_EVP_MD_ENGINE_FULL,EVP_R_INITIALIZATION_ERROR);
                                return 0;
                                }
                        /* We'll use the ENGINE's private digest definition */
@@ -165,7 +165,7 @@ static int do_evp_md_engine_full(EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *
        else
        if(!ctx->digest)
                {
-               EVPerr(EVP_F_EVP_DIGESTINIT_EX,EVP_R_NO_DIGEST_SET);
+               EVPerr(EVP_F_DO_EVP_MD_ENGINE_FULL,EVP_R_NO_DIGEST_SET);
                return 0;
                }
        return 1;
index 89eda8fd1060c50371bd2d7b2990d6380f567df8..19a558bdad1583e70ca037f90764848201887aa2 100644 (file)
@@ -222,7 +222,7 @@ static int do_evp_md_engine(EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl)
                        {
                        if (!ENGINE_init(impl))
                                {
-                               EVPerr(EVP_F_EVP_DIGESTINIT_EX,EVP_R_INITIALIZATION_ERROR);
+                               EVPerr(EVP_F_DO_EVP_MD_ENGINE,EVP_R_INITIALIZATION_ERROR);
                                return 0;
                                }
                        }
@@ -236,7 +236,7 @@ static int do_evp_md_engine(EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl)
                        if(!d)
                                {
                                /* Same comment from evp_enc.c */
-                               EVPerr(EVP_F_EVP_DIGESTINIT_EX,EVP_R_INITIALIZATION_ERROR);
+                               EVPerr(EVP_F_DO_EVP_MD_ENGINE,EVP_R_INITIALIZATION_ERROR);
                                return 0;
                                }
                        /* We'll use the ENGINE's private digest definition */
@@ -252,7 +252,7 @@ static int do_evp_md_engine(EVP_MD_CTX *ctx, const EVP_MD **ptype, ENGINE *impl)
        else
        if(!ctx->digest)
                {
-               EVPerr(EVP_F_EVP_DIGESTINIT_EX,EVP_R_NO_DIGEST_SET);
+               EVPerr(EVP_F_DO_EVP_MD_ENGINE,EVP_R_NO_DIGEST_SET);
                return 0;
                }
        return 1;
@@ -284,7 +284,7 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl)
                        if (!(type->flags & EVP_MD_FLAG_FIPS) 
                         && !(ctx->flags & EVP_MD_CTX_FLAG_NON_FIPS_ALLOW))
                                {
-                               EVPerr(EVP_F_EVP_DIGESTINIT, EVP_R_DISABLED_FOR_FIPS);
+                               EVPerr(EVP_F_EVP_DIGESTINIT_EX, EVP_R_DISABLED_FOR_FIPS);
                                ctx->digest = &bad_md;
                                return 0;
                                }
index d1b14fafc5c681169c084ff3baad31fa7dd58fcd..b7b4d1cd4808a2c21a4ea5431658a8851d08622a 100644 (file)
@@ -152,7 +152,7 @@ static int do_evp_enc_engine(EVP_CIPHER_CTX *ctx, const EVP_CIPHER **pcipher, EN
                {
                if (!ENGINE_init(impl))
                        {
-                       EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_INITIALIZATION_ERROR);
+                       EVPerr(EVP_F_DO_EVP_ENC_ENGINE, EVP_R_INITIALIZATION_ERROR);
                        return 0;
                        }
                }
@@ -169,7 +169,7 @@ static int do_evp_enc_engine(EVP_CIPHER_CTX *ctx, const EVP_CIPHER **pcipher, EN
                         * control history, is that we should at least
                         * be able to avoid using US mispellings of
                         * "initialisation"? */
-                       EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_INITIALIZATION_ERROR);
+                       EVPerr(EVP_F_DO_EVP_ENC_ENGINE, EVP_R_INITIALIZATION_ERROR);
                        return 0;
                        }
                /* We'll use the ENGINE's private cipher definition */
@@ -295,7 +295,7 @@ skip_to_init:
                if (!(ctx->cipher->flags & EVP_CIPH_FLAG_FIPS)
                        & !(ctx->flags & EVP_CIPH_FLAG_NON_FIPS_ALLOW))
                        {
-                       EVPerr(EVP_F_EVP_CIPHERINIT, EVP_R_DISABLED_FOR_FIPS);
+                       EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_DISABLED_FOR_FIPS);
 #if 0
                        ERR_add_error_data(2, "cipher=",
                                                EVP_CIPHER_name(ctx->cipher));
index b8efccae23cd3fa393c77ed22f8d2cc9cbb0a440..054902865ba3ac3ddbbe93127be224c432effce6 100644 (file)
@@ -956,6 +956,10 @@ void ERR_load_EVP_strings(void);
 #define EVP_F_ALG_MODULE_INIT                           138
 #define EVP_F_CAMELLIA_INIT_KEY                                 159
 #define EVP_F_D2I_PKEY                                  100
+#define EVP_F_DO_EVP_ENC_ENGINE                                 140
+#define EVP_F_DO_EVP_ENC_ENGINE_FULL                    141
+#define EVP_F_DO_EVP_MD_ENGINE                          139
+#define EVP_F_DO_EVP_MD_ENGINE_FULL                     142
 #define EVP_F_DSAPKEY2PKCS8                             134
 #define EVP_F_DSA_PKEY2PKCS8                            135
 #define EVP_F_ECDSA_PKEY2PKCS8                          129
@@ -1032,6 +1036,7 @@ void ERR_load_EVP_strings(void);
 #define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED             105
 #define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE                         117
 #define EVP_R_PUBLIC_KEY_NOT_RSA                        106
+#define EVP_R_SEED_KEY_SETUP_FAILED                     162
 #define EVP_R_UNKNOWN_OPTION                            149
 #define EVP_R_UNKNOWN_PBE_ALGORITHM                     121
 #define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS               135
@@ -1044,7 +1049,6 @@ void ERR_load_EVP_strings(void);
 #define EVP_R_UNSUPPORTED_SALT_TYPE                     126
 #define EVP_R_WRONG_FINAL_BLOCK_LENGTH                  109
 #define EVP_R_WRONG_PUBLIC_KEY_TYPE                     110
-#define EVP_R_SEED_KEY_SETUP_FAILED                     162
 
 #ifdef  __cplusplus
 }
index b685a5e99ecb0c21db3516d325f103ba8de1649e..be63d605c4f8a850fe1a1c6db88eccbb2a9aa716 100644 (file)
@@ -384,7 +384,7 @@ static int do_evp_enc_engine_full(EVP_CIPHER_CTX *ctx, const EVP_CIPHER **pciphe
                {
                if (!ENGINE_init(impl))
                        {
-                       EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_INITIALIZATION_ERROR);
+                       EVPerr(EVP_F_DO_EVP_ENC_ENGINE_FULL, EVP_R_INITIALIZATION_ERROR);
                        return 0;
                        }
                }
@@ -401,7 +401,7 @@ static int do_evp_enc_engine_full(EVP_CIPHER_CTX *ctx, const EVP_CIPHER **pciphe
                         * control history, is that we should at least
                         * be able to avoid using US mispellings of
                         * "initialisation"? */
-                       EVPerr(EVP_F_EVP_CIPHERINIT_EX, EVP_R_INITIALIZATION_ERROR);
+                       EVPerr(EVP_F_DO_EVP_ENC_ENGINE_FULL, EVP_R_INITIALIZATION_ERROR);
                        return 0;
                        }
                /* We'll use the ENGINE's private cipher definition */
index 69112804a97e1024e4eff01ba9cd8bdf250bc6b4..b5b900d4fe4f9d6399591bd476d97aeaf455cf66 100644 (file)
@@ -74,6 +74,10 @@ static ERR_STRING_DATA EVP_str_functs[]=
 {ERR_FUNC(EVP_F_ALG_MODULE_INIT),      "ALG_MODULE_INIT"},
 {ERR_FUNC(EVP_F_CAMELLIA_INIT_KEY),    "CAMELLIA_INIT_KEY"},
 {ERR_FUNC(EVP_F_D2I_PKEY),     "D2I_PKEY"},
+{ERR_FUNC(EVP_F_DO_EVP_ENC_ENGINE),    "DO_EVP_ENC_ENGINE"},
+{ERR_FUNC(EVP_F_DO_EVP_ENC_ENGINE_FULL),       "DO_EVP_ENC_ENGINE_FULL"},
+{ERR_FUNC(EVP_F_DO_EVP_MD_ENGINE),     "DO_EVP_MD_ENGINE"},
+{ERR_FUNC(EVP_F_DO_EVP_MD_ENGINE_FULL),        "DO_EVP_MD_ENGINE_FULL"},
 {ERR_FUNC(EVP_F_DSAPKEY2PKCS8),        "DSAPKEY2PKCS8"},
 {ERR_FUNC(EVP_F_DSA_PKEY2PKCS8),       "DSA_PKEY2PKCS8"},
 {ERR_FUNC(EVP_F_ECDSA_PKEY2PKCS8),     "ECDSA_PKEY2PKCS8"},
@@ -153,6 +157,7 @@ static ERR_STRING_DATA EVP_str_reasons[]=
 {ERR_REASON(EVP_R_NO_VERIFY_FUNCTION_CONFIGURED),"no verify function configured"},
 {ERR_REASON(EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE),"pkcs8 unknown broken type"},
 {ERR_REASON(EVP_R_PUBLIC_KEY_NOT_RSA)    ,"public key not rsa"},
+{ERR_REASON(EVP_R_SEED_KEY_SETUP_FAILED) ,"seed key setup failed"},
 {ERR_REASON(EVP_R_UNKNOWN_OPTION)        ,"unknown option"},
 {ERR_REASON(EVP_R_UNKNOWN_PBE_ALGORITHM) ,"unknown pbe algorithm"},
 {ERR_REASON(EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS),"unsuported number of rounds"},
index cbf1b297b1cfa8f935b9be09224f245d75a43379..ea89153cba3486cdcd6b9b2dfc9e7cab39a88b94 100644 (file)
@@ -137,8 +137,10 @@ void ERR_load_RAND_strings(void);
 /* Error codes for the RAND functions. */
 
 /* Function codes. */
+#define RAND_F_ENG_RAND_GET_RAND_METHOD                         108
 #define RAND_F_FIPS_RAND                                103
 #define RAND_F_FIPS_RAND_BYTES                          102
+#define RAND_F_FIPS_RAND_GET_RAND_METHOD                109
 #define RAND_F_FIPS_RAND_SET_DT                                 106
 #define RAND_F_FIPS_SET_DT                              104
 #define RAND_F_FIPS_SET_PRNG_SEED                       107
index 222430e72add013474efca2c32c2fe6597f276ef..1897d6db7032165e2fa3a9c50771d52a665abac4 100644 (file)
@@ -109,7 +109,7 @@ const RAND_METHOD *eng_RAND_get_rand_method(const RAND_METHOD **pmeth)
        if(FIPS_mode()
                && *pmeth != FIPS_rand_check())
            {
-           RANDerr(RAND_F_RAND_GET_RAND_METHOD,RAND_R_NON_FIPS_METHOD);
+           RANDerr(RAND_F_ENG_RAND_GET_RAND_METHOD,RAND_R_NON_FIPS_METHOD);
            return 0;
            }
 
index 7fa27a5d43b6c9ea071129aec5d645c37cdc39ca..829fb44d77eabbfdc21050dff000d49f2a72a8b4 100644 (file)
 
 static ERR_STRING_DATA RAND_str_functs[]=
        {
+{ERR_FUNC(RAND_F_ENG_RAND_GET_RAND_METHOD),    "ENG_RAND_GET_RAND_METHOD"},
 {ERR_FUNC(RAND_F_FIPS_RAND),   "FIPS_RAND"},
 {ERR_FUNC(RAND_F_FIPS_RAND_BYTES),     "FIPS_RAND_BYTES"},
+{ERR_FUNC(RAND_F_FIPS_RAND_GET_RAND_METHOD),   "FIPS_RAND_GET_RAND_METHOD"},
 {ERR_FUNC(RAND_F_FIPS_RAND_SET_DT),    "FIPS_RAND_SET_DT"},
 {ERR_FUNC(RAND_F_FIPS_SET_DT), "FIPS_SET_DT"},
 {ERR_FUNC(RAND_F_FIPS_SET_PRNG_SEED),  "FIPS_SET_PRNG_SEED"},
index d4bb5765f76f1f9eddc77e43e88fffa2b0c43c15..105e4e07ad98b74a2f6b9ef76c0f51c364b668f8 100644 (file)
@@ -91,7 +91,7 @@ static const RAND_METHOD *fips_RAND_get_rand_method(const RAND_METHOD **pmeth)
        if(FIPS_mode()
                && *pmeth != FIPS_rand_check())
            {
-           RANDerr(RAND_F_RAND_GET_RAND_METHOD,RAND_R_NON_FIPS_METHOD);
+           RANDerr(RAND_F_FIPS_RAND_GET_RAND_METHOD,RAND_R_NON_FIPS_METHOD);
            return 0;
            }
 
index e7a6a92c41b4ca44c6171841ff32490b793e1a18..64d9d719b6be3d5d6da391672ce1bb7c49b39b81 100644 (file)
@@ -443,6 +443,7 @@ void ERR_load_RSA_strings(void);
 #define RSA_F_RSA_PUBLIC_DECRYPT                        138
 #define RSA_F_RSA_SETUP_BLINDING                        136
 #define RSA_F_RSA_SET_DEFAULT_METHOD                    139
+#define RSA_F_RSA_SET_METHOD                            142
 #define RSA_F_RSA_SIGN                                  117
 #define RSA_F_RSA_SIGN_ASN1_OCTET_STRING                118
 #define RSA_F_RSA_VERIFY                                119
index 03410423ff4d6c83acec08c7b65eed8482edd882..383a7045b2b2d49785983c1064cc1d6b516d7cbc 100644 (file)
@@ -121,7 +121,7 @@ int RSA_set_method(RSA *rsa, const RSA_METHOD *meth)
 #ifdef OPENSSL_FIPS
        if (FIPS_mode() && !(meth->flags & RSA_FLAG_FIPS_METHOD))
                {
-               RSAerr(RSA_F_RSA_SET_DEFAULT_METHOD, RSA_R_NON_FIPS_METHOD);
+               RSAerr(RSA_F_RSA_SET_METHOD, RSA_R_NON_FIPS_METHOD);
                return 0;
                }
 #endif
@@ -180,7 +180,7 @@ RSA *RSA_new_method(ENGINE *engine)
 #ifdef OPENSSL_FIPS
        if (FIPS_mode() && !(ret->meth->flags & RSA_FLAG_FIPS_METHOD))
                {
-               RSAerr(RSA_F_RSA_SET_DEFAULT_METHOD, RSA_R_NON_FIPS_METHOD);
+               RSAerr(RSA_F_RSA_NEW_METHOD, RSA_R_NON_FIPS_METHOD);
 #ifndef OPENSSL_NO_ENGINE
                if (ret->engine)
                        ENGINE_finish(ret->engine);
index 2b4dacb979a66e003453fedd178e82db6a59ffb2..501f5ea38942368ac94729cbd40c0510dcf1a050 100644 (file)
@@ -107,6 +107,7 @@ static ERR_STRING_DATA RSA_str_functs[]=
 {ERR_FUNC(RSA_F_RSA_PUBLIC_DECRYPT),   "RSA_public_decrypt"},
 {ERR_FUNC(RSA_F_RSA_SETUP_BLINDING),   "RSA_setup_blinding"},
 {ERR_FUNC(RSA_F_RSA_SET_DEFAULT_METHOD),       "RSA_set_default_method"},
+{ERR_FUNC(RSA_F_RSA_SET_METHOD),       "RSA_set_method"},
 {ERR_FUNC(RSA_F_RSA_SIGN),     "RSA_sign"},
 {ERR_FUNC(RSA_F_RSA_SIGN_ASN1_OCTET_STRING),   "RSA_sign_ASN1_OCTET_STRING"},
 {ERR_FUNC(RSA_F_RSA_VERIFY),   "RSA_verify"},