From: Andy Polyakov Date: Sun, 21 Sep 2014 21:05:13 +0000 (+0200) Subject: crypto/rsa/rsa_chk.c: harmonize error codes. X-Git-Tag: master-post-reformat~372 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4513b1b64189df253af2a698bd1ea34bf4e794bb;p=oweals%2Fopenssl.git crypto/rsa/rsa_chk.c: harmonize error codes. Reviewed-by: Dr. Stephen Henson --- diff --git a/crypto/rsa/rsa.h b/crypto/rsa/rsa.h index d74719f57e..79905fec7f 100644 --- a/crypto/rsa/rsa.h +++ b/crypto/rsa/rsa.h @@ -523,6 +523,7 @@ void ERR_load_RSA_strings(void); #define RSA_F_RSA_ALGOR_TO_MD 156 #define RSA_F_RSA_BUILTIN_KEYGEN 129 #define RSA_F_RSA_CHECK_KEY 123 +#define RSA_F_RSA_CHECK_KEY_EX 160 #define RSA_F_RSA_CMS_DECRYPT 159 #define RSA_F_RSA_EAY_PRIVATE_DECRYPT 101 #define RSA_F_RSA_EAY_PRIVATE_ENCRYPT 102 diff --git a/crypto/rsa/rsa_chk.c b/crypto/rsa/rsa_chk.c index a351e6dee4..5afdbc4da5 100644 --- a/crypto/rsa/rsa_chk.c +++ b/crypto/rsa/rsa_chk.c @@ -67,7 +67,7 @@ int RSA_check_key_ex(const RSA *key, BN_GENCB *cb) if (!key->p || !key->q || !key->n || !key->e || !key->d) { - RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_VALUE_MISSING); + RSAerr(RSA_F_RSA_CHECK_KEY_EX, RSA_R_VALUE_MISSING); return 0; } @@ -81,7 +81,7 @@ int RSA_check_key_ex(const RSA *key, BN_GENCB *cb) m == NULL || ctx == NULL) { ret = -1; - RSAerr(RSA_F_RSA_CHECK_KEY, ERR_R_MALLOC_FAILURE); + RSAerr(RSA_F_RSA_CHECK_KEY_EX, ERR_R_MALLOC_FAILURE); goto err; } @@ -92,7 +92,7 @@ int RSA_check_key_ex(const RSA *key, BN_GENCB *cb) ret = r; if (r != 0) goto err; - RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_P_NOT_PRIME); + RSAerr(RSA_F_RSA_CHECK_KEY_EX, RSA_R_P_NOT_PRIME); } /* q prime? */ @@ -102,7 +102,7 @@ int RSA_check_key_ex(const RSA *key, BN_GENCB *cb) ret = r; if (r != 0) goto err; - RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_Q_NOT_PRIME); + RSAerr(RSA_F_RSA_CHECK_KEY_EX, RSA_R_Q_NOT_PRIME); } /* n = p*q? */ @@ -112,7 +112,7 @@ int RSA_check_key_ex(const RSA *key, BN_GENCB *cb) if (BN_cmp(i, key->n) != 0) { ret = 0; - RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_N_DOES_NOT_EQUAL_P_Q); + RSAerr(RSA_F_RSA_CHECK_KEY_EX, RSA_R_N_DOES_NOT_EQUAL_P_Q); } /* d*e = 1 mod lcm(p-1,q-1)? */ @@ -136,7 +136,7 @@ int RSA_check_key_ex(const RSA *key, BN_GENCB *cb) if (!BN_is_one(i)) { ret = 0; - RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_D_E_NOT_CONGRUENT_TO_1); + RSAerr(RSA_F_RSA_CHECK_KEY_EX, RSA_R_D_E_NOT_CONGRUENT_TO_1); } if (key->dmp1 != NULL && key->dmq1 != NULL && key->iqmp != NULL) @@ -151,7 +151,7 @@ int RSA_check_key_ex(const RSA *key, BN_GENCB *cb) if (BN_cmp(j, key->dmp1) != 0) { ret = 0; - RSAerr(RSA_F_RSA_CHECK_KEY, + RSAerr(RSA_F_RSA_CHECK_KEY_EX, RSA_R_DMP1_NOT_CONGRUENT_TO_D); } @@ -165,7 +165,7 @@ int RSA_check_key_ex(const RSA *key, BN_GENCB *cb) if (BN_cmp(j, key->dmq1) != 0) { ret = 0; - RSAerr(RSA_F_RSA_CHECK_KEY, + RSAerr(RSA_F_RSA_CHECK_KEY_EX, RSA_R_DMQ1_NOT_CONGRUENT_TO_D); } @@ -179,7 +179,7 @@ int RSA_check_key_ex(const RSA *key, BN_GENCB *cb) if (BN_cmp(i, key->iqmp) != 0) { ret = 0; - RSAerr(RSA_F_RSA_CHECK_KEY, + RSAerr(RSA_F_RSA_CHECK_KEY_EX, RSA_R_IQMP_NOT_INVERSE_OF_Q); } } diff --git a/crypto/rsa/rsa_err.c b/crypto/rsa/rsa_err.c index 93c3e1e0c5..6a5685ba52 100644 --- a/crypto/rsa/rsa_err.c +++ b/crypto/rsa/rsa_err.c @@ -1,6 +1,6 @@ /* crypto/rsa/rsa_err.c */ /* ==================================================================== - * Copyright (c) 1999-2013 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2014 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -85,6 +85,7 @@ static ERR_STRING_DATA RSA_str_functs[]= {ERR_FUNC(RSA_F_RSA_ALGOR_TO_MD), "RSA_ALGOR_TO_MD"}, {ERR_FUNC(RSA_F_RSA_BUILTIN_KEYGEN), "RSA_BUILTIN_KEYGEN"}, {ERR_FUNC(RSA_F_RSA_CHECK_KEY), "RSA_check_key"}, +{ERR_FUNC(RSA_F_RSA_CHECK_KEY_EX), "RSA_check_key_ex"}, {ERR_FUNC(RSA_F_RSA_CMS_DECRYPT), "RSA_CMS_DECRYPT"}, {ERR_FUNC(RSA_F_RSA_EAY_PRIVATE_DECRYPT), "RSA_EAY_PRIVATE_DECRYPT"}, {ERR_FUNC(RSA_F_RSA_EAY_PRIVATE_ENCRYPT), "RSA_EAY_PRIVATE_ENCRYPT"},