diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2006-07-17 16:33:31 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2006-07-17 16:33:31 +0000 |
commit | 5c95c2ac23dd30f3c458e2738598383d2ca58181 (patch) | |
tree | 181e8b7d0663eeed579bbe7f97760f0ddad52157 /crypto/rsa | |
parent | 454dbbc593cd8d9ddd7969e94c6118fc64c57f7b (diff) |
Fix various error codes to match functions.
Diffstat (limited to 'crypto/rsa')
-rw-r--r-- | crypto/rsa/rsa.h | 5 | ||||
-rw-r--r-- | crypto/rsa/rsa_ameth.c | 4 | ||||
-rw-r--r-- | crypto/rsa/rsa_err.c | 3 | ||||
-rw-r--r-- | crypto/rsa/rsa_sign.c | 14 |
4 files changed, 16 insertions, 10 deletions
diff --git a/crypto/rsa/rsa.h b/crypto/rsa/rsa.h index d24e4d7a84..31f3792a4c 100644 --- a/crypto/rsa/rsa.h +++ b/crypto/rsa/rsa.h @@ -371,7 +371,10 @@ void ERR_load_RSA_strings(void); /* Function codes. */ #define RSA_F_CHECK_PADDING_MD 140 +#define RSA_F_DO_RSA_PRINT 146 +#define RSA_F_RSA_VERIFY 119 #define RSA_F_MEMORY_LOCK 100 +#define RSA_F_OLD_RSA_PRIV_DECODE 147 #define RSA_F_PKEY_RSA_CTRL 143 #define RSA_F_PKEY_RSA_CTRL_STR 144 #define RSA_F_PKEY_RSA_SIGN 142 @@ -412,7 +415,7 @@ void ERR_load_RSA_strings(void); #define RSA_F_RSA_SETUP_BLINDING 136 #define RSA_F_RSA_SIGN 117 #define RSA_F_RSA_SIGN_ASN1_OCTET_STRING 118 -#define RSA_F_RSA_VERIFY 119 +#define RSA_F_INT_RSA_VERIFY 145 #define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING 120 #define RSA_F_RSA_VERIFY_PKCS1_PSS 126 diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c index 03785495df..a1e717f6c9 100644 --- a/crypto/rsa/rsa_ameth.c +++ b/crypto/rsa/rsa_ameth.c @@ -108,7 +108,7 @@ static int old_rsa_priv_decode(EVP_PKEY *pkey, RSA *rsa; if (!(rsa = d2i_RSAPrivateKey (NULL, pder, derlen))) { - RSAerr(RSA_F_RSA_PRIV_DECODE, ERR_R_RSA_LIB); + RSAerr(RSA_F_OLD_RSA_PRIV_DECODE, ERR_R_RSA_LIB); return 0; } EVP_PKEY_assign_RSA(pkey, rsa); @@ -200,7 +200,7 @@ static int do_rsa_print(BIO *bp, const RSA *x, int off, int priv) m=(unsigned char *)OPENSSL_malloc(buf_len+10); if (m == NULL) { - RSAerr(RSA_F_RSA_PRINT,ERR_R_MALLOC_FAILURE); + RSAerr(RSA_F_DO_RSA_PRINT,ERR_R_MALLOC_FAILURE); goto err; } diff --git a/crypto/rsa/rsa_err.c b/crypto/rsa/rsa_err.c index 7dcf766c38..163b143a73 100644 --- a/crypto/rsa/rsa_err.c +++ b/crypto/rsa/rsa_err.c @@ -71,7 +71,10 @@ static ERR_STRING_DATA RSA_str_functs[]= { {ERR_FUNC(RSA_F_CHECK_PADDING_MD), "CHECK_PADDING_MD"}, +{ERR_FUNC(RSA_F_DO_RSA_PRINT), "DO_RSA_PRINT"}, +{ERR_FUNC(RSA_F_INT_RSA_VERIFY), "INT_RSA_VERIFY"}, {ERR_FUNC(RSA_F_MEMORY_LOCK), "MEMORY_LOCK"}, +{ERR_FUNC(RSA_F_OLD_RSA_PRIV_DECODE), "OLD_RSA_PRIV_DECODE"}, {ERR_FUNC(RSA_F_PKEY_RSA_CTRL), "PKEY_RSA_CTRL"}, {ERR_FUNC(RSA_F_PKEY_RSA_CTRL_STR), "PKEY_RSA_CTRL_STR"}, {ERR_FUNC(RSA_F_PKEY_RSA_SIGN), "PKEY_RSA_SIGN"}, diff --git a/crypto/rsa/rsa_sign.c b/crypto/rsa/rsa_sign.c index 52c8c985d0..7dae5c8415 100644 --- a/crypto/rsa/rsa_sign.c +++ b/crypto/rsa/rsa_sign.c @@ -153,7 +153,7 @@ int int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, if (siglen != (unsigned int)RSA_size(rsa)) { - RSAerr(RSA_F_RSA_VERIFY,RSA_R_WRONG_SIGNATURE_LENGTH); + RSAerr(RSA_F_INT_RSA_VERIFY,RSA_R_WRONG_SIGNATURE_LENGTH); return(0); } @@ -170,11 +170,11 @@ int int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, s=(unsigned char *)OPENSSL_malloc((unsigned int)siglen); if (s == NULL) { - RSAerr(RSA_F_RSA_VERIFY,ERR_R_MALLOC_FAILURE); + RSAerr(RSA_F_INT_RSA_VERIFY,ERR_R_MALLOC_FAILURE); goto err; } if((dtype == NID_md5_sha1) && (m_len != SSL_SIG_LENGTH) ) { - RSAerr(RSA_F_RSA_VERIFY,RSA_R_INVALID_MESSAGE_LENGTH); + RSAerr(RSA_F_INT_RSA_VERIFY,RSA_R_INVALID_MESSAGE_LENGTH); goto err; } i=RSA_public_decrypt((int)siglen,sigbuf,s,rsa,RSA_PKCS1_PADDING); @@ -184,7 +184,7 @@ int int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, /* Special case: SSL signature */ if(dtype == NID_md5_sha1) { if((i != SSL_SIG_LENGTH) || memcmp(s, m, SSL_SIG_LENGTH)) - RSAerr(RSA_F_RSA_VERIFY,RSA_R_BAD_SIGNATURE); + RSAerr(RSA_F_INT_RSA_VERIFY,RSA_R_BAD_SIGNATURE); else ret = 1; } else { const unsigned char *p=s; @@ -213,7 +213,7 @@ int int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, } else { - RSAerr(RSA_F_RSA_VERIFY, + RSAerr(RSA_F_INT_RSA_VERIFY, RSA_R_ALGORITHM_MISMATCH); goto err; } @@ -223,7 +223,7 @@ int int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, const EVP_MD *md; md = EVP_get_digestbynid(dtype); if (md && (EVP_MD_size(md) != sig->digest->length)) - RSAerr(RSA_F_RSA_VERIFY, + RSAerr(RSA_F_INT_RSA_VERIFY, RSA_R_INVALID_DIGEST_LENGTH); else { @@ -236,7 +236,7 @@ int int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, else if (((unsigned int)sig->digest->length != m_len) || (memcmp(m,sig->digest->data,m_len) != 0)) { - RSAerr(RSA_F_RSA_VERIFY,RSA_R_BAD_SIGNATURE); + RSAerr(RSA_F_INT_RSA_VERIFY,RSA_R_BAD_SIGNATURE); } else ret=1; |