diff options
author | Bodo Möller <bodo@openssl.org> | 2005-05-09 00:27:37 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2005-05-09 00:27:37 +0000 |
commit | fbeaa3c47d05dd90781bdf13b9004fd274512e74 (patch) | |
tree | a1fae59f682a878df3993285bd5f79832a86fa92 /engines | |
parent | ee2262b8d7cb5966abe83b15c39e6aaf8bb8a850 (diff) |
Update util/ck_errf.pl script, and have it run automatically
during "make errors" and thus during "make update".
Fix lots of bugs that util/ck_errf.pl can detect automatically.
Various others of these are still left to fix; that's why
"make update" will complain loudly when run now.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/Makefile | 5 | ||||
-rw-r--r-- | engines/e_4758_cca.c | 42 | ||||
-rw-r--r-- | engines/e_4758_cca_err.c | 42 | ||||
-rw-r--r-- | engines/e_4758_cca_err.h | 8 | ||||
-rw-r--r-- | engines/e_aep.c | 4 | ||||
-rw-r--r-- | engines/e_aep_err.c | 58 | ||||
-rw-r--r-- | engines/e_atalla_err.c | 34 | ||||
-rw-r--r-- | engines/e_cswift.c | 4 | ||||
-rw-r--r-- | engines/e_cswift_err.c | 43 | ||||
-rw-r--r-- | engines/e_cswift_err.h | 1 | ||||
-rw-r--r-- | engines/e_gmp_err.c | 16 | ||||
-rw-r--r-- | engines/e_ncipher.c | 8 | ||||
-rw-r--r-- | engines/e_ncipher_err.c | 56 | ||||
-rw-r--r-- | engines/e_nuron_err.c | 28 | ||||
-rw-r--r-- | engines/e_sureware.c | 42 | ||||
-rw-r--r-- | engines/e_sureware_err.c | 48 | ||||
-rw-r--r-- | engines/e_sureware_err.h | 12 | ||||
-rw-r--r-- | engines/e_ubsec.c | 42 | ||||
-rw-r--r-- | engines/e_ubsec_err.c | 48 | ||||
-rw-r--r-- | engines/e_ubsec_err.h | 6 |
20 files changed, 300 insertions, 247 deletions
diff --git a/engines/Makefile b/engines/Makefile index 9d68b634c8..8aa8fa6915 100644 --- a/engines/Makefile +++ b/engines/Makefile @@ -10,6 +10,9 @@ CFLAG=-g INSTALL_PREFIX= OPENSSLDIR= /usr/local/ssl INSTALLTOP=/usr/local/ssl +PERL= perl +NEWMAKE= make +MAKE= $(NEWMAKE) MAKEDEPPROG= makedepend MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) MAKEFILE= Makefile @@ -17,7 +20,7 @@ AR= ar r PEX_LIBS= EX_LIBS= - + CFLAGS= $(INCLUDES) $(CFLAG) GENERAL=Makefile engines.com install.com engine_vector.mar diff --git a/engines/e_4758_cca.c b/engines/e_4758_cca.c index 262b373caa..685a6804c5 100644 --- a/engines/e_4758_cca.c +++ b/engines/e_4758_cca.c @@ -401,7 +401,7 @@ static EVP_PKEY *ibm_4758_load_privkey(ENGINE* e, const char* key_id, if (keyLabelLength > sizeof(keyLabel)) { - CCA4758err(CCA4758_F_IBM_4758_CCA_LOAD_PRIVKEY, + CCA4758err(CCA4758_F_IBM_4758_LOAD_PRIVKEY, CCA4758_R_SIZE_TOO_LARGE_OR_TOO_SMALL); return NULL; } @@ -412,7 +412,7 @@ static EVP_PKEY *ibm_4758_load_privkey(ENGINE* e, const char* key_id, keyToken = OPENSSL_malloc(MAX_CCA_PKA_TOKEN_SIZE + sizeof(long)); if (!keyToken) { - CCA4758err(CCA4758_F_IBM_4758_CCA_LOAD_PRIVKEY, + CCA4758err(CCA4758_F_IBM_4758_LOAD_PRIVKEY, ERR_R_MALLOC_FAILURE); goto err; } @@ -423,7 +423,7 @@ static EVP_PKEY *ibm_4758_load_privkey(ENGINE* e, const char* key_id, if (returnCode) { - CCA4758err(CCA4758_F_IBM_4758_CCA_LOAD_PRIVKEY, + CCA4758err(CCA4758_F_IBM_4758_LOAD_PRIVKEY, CCA4758_R_FAILED_LOADING_PRIVATE_KEY); goto err; } @@ -434,7 +434,7 @@ static EVP_PKEY *ibm_4758_load_privkey(ENGINE* e, const char* key_id, if (returnCode) { - CCA4758err(CCA4758_F_IBM_4758_CCA_LOAD_PRIVKEY, + CCA4758err(CCA4758_F_IBM_4758_LOAD_PRIVKEY, CCA4758_R_FAILED_LOADING_PRIVATE_KEY); goto err; } @@ -443,7 +443,7 @@ static EVP_PKEY *ibm_4758_load_privkey(ENGINE* e, const char* key_id, exponent, &modulusLength, &modulusFieldLength, modulus)) { - CCA4758err(CCA4758_F_IBM_4758_CCA_LOAD_PRIVKEY, + CCA4758err(CCA4758_F_IBM_4758_LOAD_PRIVKEY, CCA4758_R_FAILED_LOADING_PRIVATE_KEY); goto err; } @@ -493,7 +493,7 @@ static EVP_PKEY *ibm_4758_load_pubkey(ENGINE* e, const char* key_id, if (keyLabelLength > sizeof(keyLabel)) { - CCA4758err(CCA4758_F_IBM_4758_CCA_LOAD_PRIVKEY, + CCA4758err(CCA4758_F_IBM_4758_LOAD_PUBKEY, CCA4758_R_SIZE_TOO_LARGE_OR_TOO_SMALL); return NULL; } @@ -504,7 +504,7 @@ static EVP_PKEY *ibm_4758_load_pubkey(ENGINE* e, const char* key_id, keyToken = OPENSSL_malloc(MAX_CCA_PKA_TOKEN_SIZE + sizeof(long)); if (!keyToken) { - CCA4758err(CCA4758_F_IBM_4758_CCA_LOAD_PUBKEY, + CCA4758err(CCA4758_F_IBM_4758_LOAD_PUBKEY, ERR_R_MALLOC_FAILURE); goto err; } @@ -515,7 +515,7 @@ static EVP_PKEY *ibm_4758_load_pubkey(ENGINE* e, const char* key_id, if (returnCode) { - CCA4758err(CCA4758_F_IBM_4758_CCA_LOAD_PRIVKEY, + CCA4758err(CCA4758_F_IBM_4758_LOAD_PUBKEY, ERR_R_MALLOC_FAILURE); goto err; } @@ -523,7 +523,7 @@ static EVP_PKEY *ibm_4758_load_pubkey(ENGINE* e, const char* key_id, if (!getModulusAndExponent(keyToken+sizeof(long), &exponentLength, exponent, &modulusLength, &modulusFieldLength, modulus)) { - CCA4758err(CCA4758_F_IBM_4758_CCA_LOAD_PRIVKEY, + CCA4758err(CCA4758_F_IBM_4758_LOAD_PUBKEY, CCA4758_R_FAILED_LOADING_PUBLIC_KEY); goto err; } @@ -636,14 +636,14 @@ static int cca_rsa_verify(int type, const unsigned char *m, unsigned int m_len, if (!algorithm.algorithm) { - CCA4758err(CCA4758_F_IBM_4758_CCA_VERIFY, + CCA4758err(CCA4758_F_CCA_RSA_VERIFY, CCA4758_R_UNKNOWN_ALGORITHM_TYPE); return 0; } if (!algorithm.algorithm->length) { - CCA4758err(CCA4758_F_IBM_4758_CCA_VERIFY, + CCA4758err(CCA4758_F_CCA_RSA_VERIFY, CCA4758_R_ASN1_OID_UNKNOWN_FOR_MD); return 0; } @@ -663,7 +663,7 @@ static int cca_rsa_verify(int type, const unsigned char *m, unsigned int m_len, if (length - RSA_PKCS1_PADDING > keyLength) { - CCA4758err(CCA4758_F_IBM_4758_CCA_VERIFY, + CCA4758err(CCA4758_F_CCA_RSA_VERIFY, CCA4758_R_SIZE_TOO_LARGE_OR_TOO_SMALL); return 0; } @@ -673,7 +673,7 @@ static int cca_rsa_verify(int type, const unsigned char *m, unsigned int m_len, case NID_md5_sha1 : if (m_len != SSL_SIG_LEN) { - CCA4758err(CCA4758_F_IBM_4758_CCA_VERIFY, + CCA4758err(CCA4758_F_CCA_RSA_VERIFY, CCA4758_R_SIZE_TOO_LARGE_OR_TOO_SMALL); return 0; } @@ -688,7 +688,7 @@ static int cca_rsa_verify(int type, const unsigned char *m, unsigned int m_len, (unsigned int)keyLength+1); if (!hashBuffer) { - CCA4758err(CCA4758_F_IBM_4758_CCA_VERIFY, + CCA4758err(CCA4758_F_CCA_RSA_VERIFY, ERR_R_MALLOC_FAILURE); return 0; } @@ -703,7 +703,7 @@ static int cca_rsa_verify(int type, const unsigned char *m, unsigned int m_len, (unsigned int)keyLength+1); if (!hashBuffer) { - CCA4758err(CCA4758_F_IBM_4758_CCA_VERIFY, + CCA4758err(CCA4758_F_CCA_RSA_VERIFY, ERR_R_MALLOC_FAILURE); return 0; } @@ -760,14 +760,14 @@ static int cca_rsa_sign(int type, const unsigned char *m, unsigned int m_len, if (!algorithm.algorithm) { - CCA4758err(CCA4758_F_IBM_4758_CCA_SIGN, + CCA4758err(CCA4758_F_CCA_RSA_SIGN, CCA4758_R_UNKNOWN_ALGORITHM_TYPE); return 0; } if (!algorithm.algorithm->length) { - CCA4758err(CCA4758_F_IBM_4758_CCA_SIGN, + CCA4758err(CCA4758_F_CCA_RSA_SIGN, CCA4758_R_ASN1_OID_UNKNOWN_FOR_MD); return 0; } @@ -787,7 +787,7 @@ static int cca_rsa_sign(int type, const unsigned char *m, unsigned int m_len, if (length - RSA_PKCS1_PADDING > keyLength) { - CCA4758err(CCA4758_F_IBM_4758_CCA_SIGN, + CCA4758err(CCA4758_F_CCA_RSA_SIGN, CCA4758_R_SIZE_TOO_LARGE_OR_TOO_SMALL); return 0; } @@ -797,7 +797,7 @@ static int cca_rsa_sign(int type, const unsigned char *m, unsigned int m_len, case NID_md5_sha1 : if (m_len != SSL_SIG_LEN) { - CCA4758err(CCA4758_F_IBM_4758_CCA_SIGN, + CCA4758err(CCA4758_F_CCA_RSA_SIGN, CCA4758_R_SIZE_TOO_LARGE_OR_TOO_SMALL); return 0; } @@ -811,7 +811,7 @@ static int cca_rsa_sign(int type, const unsigned char *m, unsigned int m_len, (unsigned int)keyLength+1); if (!hashBuffer) { - CCA4758err(CCA4758_F_IBM_4758_CCA_VERIFY, + CCA4758err(CCA4758_F_CCA_RSA_SIGN, ERR_R_MALLOC_FAILURE); return 0; } @@ -825,7 +825,7 @@ static int cca_rsa_sign(int type, const unsigned char *m, unsigned int m_len, (unsigned int)keyLength+1); if (!hashBuffer) { - CCA4758err(CCA4758_F_IBM_4758_CCA_VERIFY, + CCA4758err(CCA4758_F_CCA_RSA_SIGN, ERR_R_MALLOC_FAILURE); return 0; } diff --git a/engines/e_4758_cca_err.c b/engines/e_4758_cca_err.c index 12c6d2eeda..5d26450fe1 100644 --- a/engines/e_4758_cca_err.c +++ b/engines/e_4758_cca_err.c @@ -1,6 +1,6 @@ -/* hw_4758_cca_err.c */ +/* e_4758_cca_err.c */ /* ==================================================================== - * Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2005 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 @@ -64,30 +64,34 @@ /* BEGIN ERROR CODES */ #ifndef OPENSSL_NO_ERR + +#define ERR_FUNC(func) ERR_PACK(0,func,0) +#define ERR_REASON(reason) ERR_PACK(0,0,reason) + static ERR_STRING_DATA CCA4758_str_functs[]= { -{ERR_PACK(0,CCA4758_F_IBM_4758_CCA_CTRL,0), "IBM_4758_CCA_CTRL"}, -{ERR_PACK(0,CCA4758_F_IBM_4758_CCA_FINISH,0), "IBM_4758_CCA_FINISH"}, -{ERR_PACK(0,CCA4758_F_IBM_4758_CCA_INIT,0), "IBM_4758_CCA_INIT"}, -{ERR_PACK(0,CCA4758_F_IBM_4758_CCA_LOAD_PRIVKEY,0), "IBM_4758_CCA_LOAD_PRIVKEY"}, -{ERR_PACK(0,CCA4758_F_IBM_4758_CCA_LOAD_PUBKEY,0), "IBM_4758_CCA_LOAD_PUBKEY"}, -{ERR_PACK(0,CCA4758_F_IBM_4758_CCA_SIGN,0), "IBM_4758_CCA_SIGN"}, -{ERR_PACK(0,CCA4758_F_IBM_4758_CCA_VERIFY,0), "IBM_4758_CCA_VERIFY"}, +{ERR_FUNC(CCA4758_F_CCA_RSA_SIGN), "CCA_RSA_SIGN"}, +{ERR_FUNC(CCA4758_F_CCA_RSA_VERIFY), "CCA_RSA_VERIFY"}, +{ERR_FUNC(CCA4758_F_IBM_4758_CCA_CTRL), "IBM_4758_CCA_CTRL"}, +{ERR_FUNC(CCA4758_F_IBM_4758_CCA_FINISH), "IBM_4758_CCA_FINISH"}, +{ERR_FUNC(CCA4758_F_IBM_4758_CCA_INIT), "IBM_4758_CCA_INIT"}, +{ERR_FUNC(CCA4758_F_IBM_4758_LOAD_PRIVKEY), "IBM_4758_LOAD_PRIVKEY"}, +{ERR_FUNC(CCA4758_F_IBM_4758_LOAD_PUBKEY), "IBM_4758_LOAD_PUBKEY"}, {0,NULL} }; static ERR_STRING_DATA CCA4758_str_reasons[]= { -{CCA4758_R_ALREADY_LOADED ,"already loaded"}, -{CCA4758_R_ASN1_OID_UNKNOWN_FOR_MD ,"asn1 oid unknown for md"}, -{CCA4758_R_COMMAND_NOT_IMPLEMENTED ,"command not implemented"}, -{CCA4758_R_DSO_FAILURE ,"dso failure"}, -{CCA4758_R_FAILED_LOADING_PRIVATE_KEY ,"failed loading private key"}, -{CCA4758_R_FAILED_LOADING_PUBLIC_KEY ,"failed loading public key"}, -{CCA4758_R_NOT_LOADED ,"not loaded"}, -{CCA4758_R_SIZE_TOO_LARGE_OR_TOO_SMALL ,"size too large or too small"}, -{CCA4758_R_UNIT_FAILURE ,"unit failure"}, -{CCA4758_R_UNKNOWN_ALGORITHM_TYPE ,"unknown algorithm type"}, +{ERR_REASON(CCA4758_R_ALREADY_LOADED) ,"already loaded"}, +{ERR_REASON(CCA4758_R_ASN1_OID_UNKNOWN_FOR_MD),"asn1 oid unknown for md"}, +{ERR_REASON(CCA4758_R_COMMAND_NOT_IMPLEMENTED),"command not implemented"}, +{ERR_REASON(CCA4758_R_DSO_FAILURE) ,"dso failure"}, +{ERR_REASON(CCA4758_R_FAILED_LOADING_PRIVATE_KEY),"failed loading private key"}, +{ERR_REASON(CCA4758_R_FAILED_LOADING_PUBLIC_KEY),"failed loading public key"}, +{ERR_REASON(CCA4758_R_NOT_LOADED) ,"not loaded"}, +{ERR_REASON(CCA4758_R_SIZE_TOO_LARGE_OR_TOO_SMALL),"size too large or too small"}, +{ERR_REASON(CCA4758_R_UNIT_FAILURE) ,"unit failure"}, +{ERR_REASON(CCA4758_R_UNKNOWN_ALGORITHM_TYPE),"unknown algorithm type"}, {0,NULL} }; diff --git a/engines/e_4758_cca_err.h b/engines/e_4758_cca_err.h index 2fc563ab11..3d4276be91 100644 --- a/engines/e_4758_cca_err.h +++ b/engines/e_4758_cca_err.h @@ -67,13 +67,13 @@ static void ERR_CCA4758_error(int function, int reason, char *file, int line); /* Error codes for the CCA4758 functions. */ /* Function codes. */ +#define CCA4758_F_CCA_RSA_SIGN 105 +#define CCA4758_F_CCA_RSA_VERIFY 106 #define CCA4758_F_IBM_4758_CCA_CTRL 100 #define CCA4758_F_IBM_4758_CCA_FINISH 101 #define CCA4758_F_IBM_4758_CCA_INIT 102 -#define CCA4758_F_IBM_4758_CCA_LOAD_PRIVKEY 103 -#define CCA4758_F_IBM_4758_CCA_LOAD_PUBKEY 104 -#define CCA4758_F_IBM_4758_CCA_SIGN 105 -#define CCA4758_F_IBM_4758_CCA_VERIFY 106 +#define CCA4758_F_IBM_4758_LOAD_PRIVKEY 103 +#define CCA4758_F_IBM_4758_LOAD_PUBKEY 104 /* Reason codes. */ #define CCA4758_R_ALREADY_LOADED 100 diff --git a/engines/e_aep.c b/engines/e_aep.c index d3a3ec6e1f..f3e27fb01d 100644 --- a/engines/e_aep.c +++ b/engines/e_aep.c @@ -620,7 +620,7 @@ static int aep_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, rv = aep_return_connection(hConnection); if (rv != AEP_R_OK) { - AEPHKerr(AEPHK_F_AEP_RAND,AEPHK_R_RETURN_CONNECTION_FAILED); + AEPHKerr(AEPHK_F_AEP_MOD_EXP,AEPHK_R_RETURN_CONNECTION_FAILED); goto err; } @@ -658,7 +658,7 @@ static AEP_RV aep_mod_exp_crt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, rv = aep_return_connection(hConnection); if (rv != AEP_R_OK) { - AEPHKerr(AEPHK_F_AEP_RAND,AEPHK_R_RETURN_CONNECTION_FAILED); + AEPHKerr(AEPHK_F_AEP_MOD_EXP_CRT,AEPHK_R_RETURN_CONNECTION_FAILED); goto err; } diff --git a/engines/e_aep_err.c b/engines/e_aep_err.c index 3a0e72463c..3f95881cab 100644 --- a/engines/e_aep_err.c +++ b/engines/e_aep_err.c @@ -1,6 +1,6 @@ -/* hw_aep_err.c */ +/* e_aep_err.c */ /* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2005 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 @@ -64,38 +64,42 @@ /* BEGIN ERROR CODES */ #ifndef OPENSSL_NO_ERR + +#define ERR_FUNC(func) ERR_PACK(0,func,0) +#define ERR_REASON(reason) ERR_PACK(0,0,reason) + static ERR_STRING_DATA AEPHK_str_functs[]= { -{ERR_PACK(0,AEPHK_F_AEP_CTRL,0), "AEP_CTRL"}, -{ERR_PACK(0,AEPHK_F_AEP_FINISH,0), "AEP_FINISH"}, -{ERR_PACK(0,AEPHK_F_AEP_GET_CONNECTION,0), "AEP_GET_CONNECTION"}, -{ERR_PACK(0,AEPHK_F_AEP_INIT,0), "AEP_INIT"}, -{ERR_PACK(0,AEPHK_F_AEP_MOD_EXP,0), "AEP_MOD_EXP"}, -{ERR_PACK(0,AEPHK_F_AEP_MOD_EXP_CRT,0), "AEP_MOD_EXP_CRT"}, -{ERR_PACK(0,AEPHK_F_AEP_RAND,0), "AEP_RAND"}, -{ERR_PACK(0,AEPHK_F_AEP_RSA_MOD_EXP,0), "AEP_RSA_MOD_EXP"}, +{ERR_FUNC(AEPHK_F_AEP_CTRL), "AEP_CTRL"}, +{ERR_FUNC(AEPHK_F_AEP_FINISH), "AEP_FINISH"}, +{ERR_FUNC(AEPHK_F_AEP_GET_CONNECTION), "AEP_GET_CONNECTION"}, +{ERR_FUNC(AEPHK_F_AEP_INIT), "AEP_INIT"}, +{ERR_FUNC(AEPHK_F_AEP_MOD_EXP), "AEP_MOD_EXP"}, +{ERR_FUNC(AEPHK_F_AEP_MOD_EXP_CRT), "AEP_MOD_EXP_CRT"}, +{ERR_FUNC(AEPHK_F_AEP_RAND), "AEP_RAND"}, +{ERR_FUNC(AEPHK_F_AEP_RSA_MOD_EXP), "AEP_RSA_MOD_EXP"}, {0,NULL} }; static ERR_STRING_DATA AEPHK_str_reasons[]= { -{AEPHK_R_ALREADY_LOADED ,"already loaded"}, -{AEPHK_R_CLOSE_HANDLES_FAILED ,"close handles failed"}, -{AEPHK_R_CONNECTIONS_IN_USE ,"connections in use"}, -{AEPHK_R_CTRL_COMMAND_NOT_IMPLEMENTED ,"ctrl command not implemented"}, -{AEPHK_R_FINALIZE_FAILED ,"finalize failed"}, -{AEPHK_R_GET_HANDLE_FAILED ,"get handle failed"}, -{AEPHK_R_GET_RANDOM_FAILED ,"get random failed"}, -{AEPHK_R_INIT_FAILURE ,"init failure"}, -{AEPHK_R_MISSING_KEY_COMPONENTS ,"missing key components"}, -{AEPHK_R_MOD_EXP_CRT_FAILED ,"mod exp crt failed"}, -{AEPHK_R_MOD_EXP_FAILED ,"mod exp failed"}, -{AEPHK_R_NOT_LOADED ,"not loaded"}, -{AEPHK_R_OK ,"ok"}, -{AEPHK_R_RETURN_CONNECTION_FAILED ,"return connection failed"}, -{AEPHK_R_SETBNCALLBACK_FAILURE ,"setbncallback failure"}, -{AEPHK_R_SIZE_TOO_LARGE_OR_TOO_SMALL ,"size too large or too small"}, -{AEPHK_R_UNIT_FAILURE ,"unit failure"}, +{ERR_REASON(AEPHK_R_ALREADY_LOADED) ,"already loaded"}, +{ERR_REASON(AEPHK_R_CLOSE_HANDLES_FAILED),"close handles failed"}, +{ERR_REASON(AEPHK_R_CONNECTIONS_IN_USE) ,"connections in use"}, +{ERR_REASON(AEPHK_R_CTRL_COMMAND_NOT_IMPLEMENTED),"ctrl command not implemented"}, +{ERR_REASON(AEPHK_R_FINALIZE_FAILED) ,"finalize failed"}, +{ERR_REASON(AEPHK_R_GET_HANDLE_FAILED) ,"get handle failed"}, +{ERR_REASON(AEPHK_R_GET_RANDOM_FAILED) ,"get random failed"}, +{ERR_REASON(AEPHK_R_INIT_FAILURE) ,"init failure"}, +{ERR_REASON(AEPHK_R_MISSING_KEY_COMPONENTS),"missing key components"}, +{ERR_REASON(AEPHK_R_MOD_EXP_CRT_FAILED) ,"mod exp crt failed"}, +{ERR_REASON(AEPHK_R_MOD_EXP_FAILED) ,"mod exp failed"}, +{ERR_REASON(AEPHK_R_NOT_LOADED) ,"not loaded"}, +{ERR_REASON(AEPHK_R_OK) ,"ok"}, +{ERR_REASON(AEPHK_R_RETURN_CONNECTION_FAILED),"return connection failed"}, +{ERR_REASON(AEPHK_R_SETBNCALLBACK_FAILURE),"setbncallback failure"}, +{ERR_REASON(AEPHK_R_SIZE_TOO_LARGE_OR_TOO_SMALL),"size too large or too small"}, +{ERR_REASON(AEPHK_R_UNIT_FAILURE) ,"unit failure"}, {0,NULL} }; diff --git a/engines/e_atalla_err.c b/engines/e_atalla_err.c index 94f637a613..fd3e0049ce 100644 --- a/engines/e_atalla_err.c +++ b/engines/e_atalla_err.c @@ -1,6 +1,6 @@ -/* hw_atalla_err.c */ +/* e_atalla_err.c */ /* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2005 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 @@ -64,26 +64,30 @@ /* BEGIN ERROR CODES */ #ifndef OPENSSL_NO_ERR + +#define ERR_FUNC(func) ERR_PACK(0,func,0) +#define ERR_REASON(reason) ERR_PACK(0,0,reason) + static ERR_STRING_DATA ATALLA_str_functs[]= { -{ERR_PACK(0,ATALLA_F_ATALLA_CTRL,0), "ATALLA_CTRL"}, -{ERR_PACK(0,ATALLA_F_ATALLA_FINISH,0), "ATALLA_FINISH"}, -{ERR_PACK(0,ATALLA_F_ATALLA_INIT,0), "ATALLA_INIT"}, -{ERR_PACK(0,ATALLA_F_ATALLA_MOD_EXP,0), "ATALLA_MOD_EXP"}, -{ERR_PACK(0,ATALLA_F_ATALLA_RSA_MOD_EXP,0), "ATALLA_RSA_MOD_EXP"}, +{ERR_FUNC(ATALLA_F_ATALLA_CTRL), "ATALLA_CTRL"}, +{ERR_FUNC(ATALLA_F_ATALLA_FINISH), "ATALLA_FINISH"}, +{ERR_FUNC(ATALLA_F_ATALLA_INIT), "ATALLA_INIT"}, +{ERR_FUNC(ATALLA_F_ATALLA_MOD_EXP), "ATALLA_MOD_EXP"}, +{ERR_FUNC(ATALLA_F_ATALLA_RSA_MOD_EXP), "ATALLA_RSA_MOD_EXP"}, {0,NULL} }; static ERR_STRING_DATA ATALLA_str_reasons[]= { -{ATALLA_R_ALREADY_LOADED ,"already loaded"}, -{ATALLA_R_BN_CTX_FULL ,"bn ctx full"}, -{ATALLA_R_BN_EXPAND_FAIL ,"bn expand fail"}, -{ATALLA_R_CTRL_COMMAND_NOT_IMPLEMENTED ,"ctrl command not implemented"}, -{ATALLA_R_MISSING_KEY_COMPONENTS ,"missing key components"}, -{ATALLA_R_NOT_LOADED ,"not loaded"}, -{ATALLA_R_REQUEST_FAILED ,"request failed"}, -{ATALLA_R_UNIT_FAILURE ,"unit failure"}, +{ERR_REASON(ATALLA_R_ALREADY_LOADED) ,"already loaded"}, +{ERR_REASON(ATALLA_R_BN_CTX_FULL) ,"bn ctx full"}, +{ERR_REASON(ATALLA_R_BN_EXPAND_FAIL) ,"bn expand fail"}, +{ERR_REASON(ATALLA_R_CTRL_COMMAND_NOT_IMPLEMENTED),"ctrl command not implemented"}, +{ERR_REASON(ATALLA_R_MISSING_KEY_COMPONENTS),"missing key components"}, +{ERR_REASON(ATALLA_R_NOT_LOADED) ,"not loaded"}, +{ERR_REASON(ATALLA_R_REQUEST_FAILED) ,"request failed"}, +{ERR_REASON(ATALLA_R_UNIT_FAILURE) ,"unit failure"}, {0,NULL} }; diff --git a/engines/e_cswift.c b/engines/e_cswift.c index 0f9c1b264c..f86c0573a8 100644 --- a/engines/e_cswift.c +++ b/engines/e_cswift.c @@ -943,7 +943,7 @@ static int cswift_rand_bytes(unsigned char *buf, int num) if (!get_context(&hac)) { - CSWIFTerr(CSWIFT_F_CSWIFT_CTRL, CSWIFT_R_UNIT_FAILURE); + CSWIFTerr(CSWIFT_F_CSWIFT_RAND_BYTES, CSWIFT_R_UNIT_FAILURE); goto err; } acquired = 1; @@ -963,7 +963,7 @@ static int cswift_rand_bytes(unsigned char *buf, int num) if (swrc != SW_OK) { char tmpbuf[20]; - CSWIFTerr(CSWIFT_F_CSWIFT_CTRL, CSWIFT_R_REQUEST_FAILED); + CSWIFTerr(CSWIFT_F_CSWIFT_RAND_BYTES, CSWIFT_R_REQUEST_FAILED); sprintf(tmpbuf, "%ld", swrc); ERR_add_error_data(2, "CryptoSwift error number is ", tmpbuf); goto err; diff --git a/engines/e_cswift_err.c b/engines/e_cswift_err.c index 3c1111ba40..c7942a31fc 100644 --- a/engines/e_cswift_err.c +++ b/engines/e_cswift_err.c @@ -1,6 +1,6 @@ -/* hw_cswift_err.c */ +/* e_cswift_err.c */ /* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2005 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 @@ -64,30 +64,35 @@ /* BEGIN ERROR CODES */ #ifndef OPENSSL_NO_ERR + +#define ERR_FUNC(func) ERR_PACK(0,func,0) +#define ERR_REASON(reason) ERR_PACK(0,0,reason) + static ERR_STRING_DATA CSWIFT_str_functs[]= { -{ERR_PACK(0,CSWIFT_F_CSWIFT_CTRL,0), "CSWIFT_CTRL"}, -{ERR_PACK(0,CSWIFT_F_CSWIFT_DSA_SIGN,0), "CSWIFT_DSA_SIGN"}, -{ERR_PACK(0,CSWIFT_F_CSWIFT_DSA_VERIFY,0), "CSWIFT_DSA_VERIFY"}, -{ERR_PACK(0,CSWIFT_F_CSWIFT_FINISH,0), "CSWIFT_FINISH"}, -{ERR_PACK(0,CSWIFT_F_CSWIFT_INIT,0), "CSWIFT_INIT"}, -{ERR_PACK(0,CSWIFT_F_CSWIFT_MOD_EXP,0), "CSWIFT_MOD_EXP"}, -{ERR_PACK(0,CSWIFT_F_CSWIFT_MOD_EXP_CRT,0), "CSWIFT_MOD_EXP_CRT"}, -{ERR_PACK(0,CSWIFT_F_CSWIFT_RSA_MOD_EXP,0), "CSWIFT_RSA_MOD_EXP"}, +{ERR_FUNC(CSWIFT_F_CSWIFT_CTRL), "CSWIFT_CTRL"}, +{ERR_FUNC(CSWIFT_F_CSWIFT_DSA_SIGN), "CSWIFT_DSA_SIGN"}, +{ERR_FUNC(CSWIFT_F_CSWIFT_DSA_VERIFY), "CSWIFT_DSA_VERIFY"}, +{ERR_FUNC(CSWIFT_F_CSWIFT_FINISH), "CSWIFT_FINISH"}, +{ERR_FUNC(CSWIFT_F_CSWIFT_INIT), "CSWIFT_INIT"}, +{ERR_FUNC(CSWIFT_F_CSWIFT_MOD_EXP), "CSWIFT_MOD_EXP"}, +{ERR_FUNC(CSWIFT_F_CSWIFT_MOD_EXP_CRT), "CSWIFT_MOD_EXP_CRT"}, +{ERR_FUNC(CSWIFT_F_CSWIFT_RAND_BYTES), "CSWIFT_RAND_BYTES"}, +{ERR_FUNC(CSWIFT_F_CSWIFT_RSA_MOD_EXP), "CSWIFT_RSA_MOD_EXP"}, {0,NULL} }; static ERR_STRING_DATA CSWIFT_str_reasons[]= { -{CSWIFT_R_ALREADY_LOADED ,"already loaded"}, -{CSWIFT_R_BAD_KEY_SIZE ,"bad key size"}, -{CSWIFT_R_BN_CTX_FULL ,"bn ctx full"}, -{CSWIFT_R_BN_EXPAND_FAIL ,"bn expand fail"}, -{CSWIFT_R_CTRL_COMMAND_NOT_IMPLEMENTED ,"ctrl command not implemented"}, -{CSWIFT_R_MISSING_KEY_COMPONENTS ,"missing key components"}, -{CSWIFT_R_NOT_LOADED ,"not loaded"}, -{CSWIFT_R_REQUEST_FAILED ,"request failed"}, -{CSWIFT_R_UNIT_FAILURE ,"unit failure"}, +{ERR_REASON(CSWIFT_R_ALREADY_LOADED) ,"already loaded"}, +{ERR_REASON(CSWIFT_R_BAD_KEY_SIZE) ,"bad key size"}, +{ERR_REASON(CSWIFT_R_BN_CTX_FULL) ,"bn ctx full"}, +{ERR_REASON(CSWIFT_R_BN_EXPAND_FAIL) ,"bn expand fail"}, +{ERR_REASON(CSWIFT_R_CTRL_COMMAND_NOT_IMPLEMENTED),"ctrl command not implemented"}, +{ERR_REASON(CSWIFT_R_MISSING_KEY_COMPONENTS),"missing key components"}, +{ERR_REASON(CSWIFT_R_NOT_LOADED) ,"not loaded"}, +{ERR_REASON(CSWIFT_R_REQUEST_FAILED) ,"request failed"}, +{ERR_REASON(CSWIFT_R_UNIT_FAILURE) ,"unit failure"}, {0,NULL} }; diff --git a/engines/e_cswift_err.h b/engines/e_cswift_err.h index 7120c3216f..9072cbe616 100644 --- a/engines/e_cswift_err.h +++ b/engines/e_cswift_err.h @@ -74,6 +74,7 @@ static void ERR_CSWIFT_error(int function, int reason, char *file, int line); #define CSWIFT_F_CSWIFT_INIT 104 #define CSWIFT_F_CSWIFT_MOD_EXP 105 #define CSWIFT_F_CSWIFT_MOD_EXP_CRT 106 +#define CSWIFT_F_CSWIFT_RAND_BYTES 108 #define CSWIFT_F_CSWIFT_RSA_MOD_EXP 107 /* Reason codes. */ diff --git a/engines/e_gmp_err.c b/engines/e_gmp_err.c index 383832ad2f..61db956796 100644 --- a/engines/e_gmp_err.c +++ b/engines/e_gmp_err.c @@ -1,6 +1,6 @@ /* e_gmp_err.c */ /* ==================================================================== - * Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2005 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 @@ -64,18 +64,22 @@ /* BEGIN ERROR CODES */ #ifndef OPENSSL_NO_ERR + +#define ERR_FUNC(func) ERR_PACK(0,func,0) +#define ERR_REASON(reason) ERR_PACK(0,0,reason) + static ERR_STRING_DATA GMP_str_functs[]= { -{ERR_PACK(0,GMP_F_E_GMP_CTRL,0), "E_GMP_CTRL"}, -{ERR_PACK(0,GMP_F_E_GMP_RSA_MOD_EXP,0), "E_GMP_RSA_MOD_EXP"}, +{ERR_FUNC(GMP_F_E_GMP_CTRL), "E_GMP_CTRL"}, +{ERR_FUNC(GMP_F_E_GMP_RSA_MOD_EXP), "E_GMP_RSA_MOD_EXP"}, {0,NULL} }; static ERR_STRING_DATA GMP_str_reasons[]= { -{GMP_R_CTRL_COMMAND_NOT_IMPLEMENTED ,"ctrl command not implemented"}, -{GMP_R_KEY_CONTEXT_ERROR ,"key context error"}, -{GMP_R_MISSING_KEY_COMPONENTS ,"missing key components"}, +{ERR_REASON(GMP_R_CTRL_COMMAND_NOT_IMPLEMENTED),"ctrl command not implemented"}, +{ERR_REASON(GMP_R_KEY_CONTEXT_ERROR) ,"key context error"}, +{ERR_REASON(GMP_R_MISSING_KEY_COMPONENTS),"missing key components"}, {0,NULL} }; diff --git a/engines/e_ncipher.c b/engines/e_ncipher.c index 7564f6d2b4..b5f054bb86 100644 --- a/engines/e_ncipher.c +++ b/engines/e_ncipher.c @@ -808,7 +808,7 @@ static EVP_PKEY *hwcrhk_load_privkey(ENGINE *eng, const char *key_id, if (p_hwcrhk_RSAGetPublicKey(*hptr, &n, &e, &rmsg) != HWCRYPTOHOOK_ERROR_MPISIZE) { - HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PUBKEY,HWCRHK_R_CHIL_ERROR); + HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PRIVKEY,HWCRHK_R_CHIL_ERROR); ERR_add_error_data(1,rmsg.buf); goto err; } @@ -820,7 +820,7 @@ static EVP_PKEY *hwcrhk_load_privkey(ENGINE *eng, const char *key_id, if (p_hwcrhk_RSAGetPublicKey(*hptr, &n, &e, &rmsg)) { - HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PUBKEY, + HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PRIVKEY, HWCRHK_R_CHIL_ERROR); ERR_add_error_data(1,rmsg.buf); goto err; @@ -835,7 +835,7 @@ static EVP_PKEY *hwcrhk_load_privkey(ENGINE *eng, const char *key_id, #endif if (!res) - HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PUBKEY, + HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PRIVKEY, HWCRHK_R_PRIVATE_KEY_ALGORITHMS_DISABLED); return res; @@ -962,7 +962,7 @@ static int hwcrhk_rsa_mod_exp(BIGNUM *r, const BIGNUM *I, RSA *rsa, BN_CTX *ctx) if(!hwcrhk_context) { - HWCRHKerr(HWCRHK_F_HWCRHK_MOD_EXP,HWCRHK_R_NOT_INITIALISED); + HWCRHKerr(HWCRHK_F_HWCRHK_RSA_MOD_EXP,HWCRHK_R_NOT_INITIALISED); goto err; } diff --git a/engines/e_ncipher_err.c b/engines/e_ncipher_err.c index 6716517d9e..b219a88616 100644 --- a/engines/e_ncipher_err.c +++ b/engines/e_ncipher_err.c @@ -1,6 +1,6 @@ /* e_ncipher_err.c */ /* ==================================================================== - * Copyright (c) 1999-2002 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2005 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 @@ -64,38 +64,42 @@ /* BEGIN ERROR CODES */ #ifndef OPENSSL_NO_ERR + +#define ERR_FUNC(func) ERR_PACK(0,func,0) +#define ERR_REASON(reason) ERR_PACK(0,0,reason) + static ERR_STRING_DATA HWCRHK_str_functs[]= { -{ERR_PACK(0,HWCRHK_F_HWCRHK_CTRL,0), "HWCRHK_CTRL"}, -{ERR_PACK(0,HWCRHK_F_HWCRHK_FINISH,0), "HWCRHK_FINISH"}, -{ERR_PACK(0,HWCRHK_F_HWCRHK_GET_PASS,0), "HWCRHK_GET_PASS"}, -{ERR_PACK(0,HWCRHK_F_HWCRHK_INIT,0), "HWCRHK_INIT"}, -{ERR_PACK(0,HWCRHK_F_HWCRHK_INSERT_CARD,0), "HWCRHK_INSERT_CARD"}, -{ERR_PACK(0,HWCRHK_F_HWCRHK_LOAD_PRIVKEY,0), "HWCRHK_LOAD_PRIVKEY"}, -{ERR_PACK(0,HWCRHK_F_HWCRHK_LOAD_PUBKEY,0), "HWCRHK_LOAD_PUBKEY"}, -{ERR_PACK(0,HWCRHK_F_HWCRHK_MOD_EXP,0), "HWCRHK_MOD_EXP"}, -{ERR_PACK(0,HWCRHK_F_HWCRHK_RAND_BYTES,0), "HWCRHK_RAND_BYTES"}, -{ERR_PACK(0,HWCRHK_F_HWCRHK_RSA_MOD_EXP,0), "HWCRHK_RSA_MOD_EXP"}, +{ERR_FUNC(HWCRHK_F_HWCRHK_CTRL), "HWCRHK_CTRL"}, +{ERR_FUNC(HWCRHK_F_HWCRHK_FINISH), "HWCRHK_FINISH"}, +{ERR_FUNC(HWCRHK_F_HWCRHK_GET_PASS), "HWCRHK_GET_PASS"}, +{ERR_FUNC(HWCRHK_F_HWCRHK_INIT), "HWCRHK_INIT"}, +{ERR_FUNC(HWCRHK_F_HWCRHK_INSERT_CARD), "HWCRHK_INSERT_CARD"}, +{ERR_FUNC(HWCRHK_F_HWCRHK_LOAD_PRIVKEY), "HWCRHK_LOAD_PRIVKEY"}, +{ERR_FUNC(HWCRHK_F_HWCRHK_LOAD_PUBKEY), "HWCRHK_LOAD_PUBKEY"}, +{ERR_FUNC(HWCRHK_F_HWCRHK_MOD_EXP), "HWCRHK_MOD_EXP"}, +{ERR_FUNC(HWCRHK_F_HWCRHK_RAND_BYTES), "HWCRHK_RAND_BYTES"}, +{ERR_FUNC(HWCRHK_F_HWCRHK_RSA_MOD_EXP), "HWCRHK_RSA_MOD_EXP"}, {0,NULL} }; static ERR_STRING_DATA HWCRHK_str_reasons[]= { -{HWCRHK_R_ALREADY_LOADED ,"already loaded"}, -{HWCRHK_R_BIO_WAS_FREED ,"bio was freed"}, -{HWCRHK_R_CHIL_ERROR ,"chil error"}, -{HWCRHK_R_CTRL_COMMAND_NOT_IMPLEMENTED ,"ctrl command not implemented"}, -{HWCRHK_R_DSO_FAILURE ,"dso failure"}, -{HWCRHK_R_LOCKING_MISSING ,"locking missing"}, -{HWCRHK_R_MISSING_KEY_COMPONENTS ,"missing key components"}, -{HWCRHK_R_NOT_INITIALISED ,"not initialised"}, -{HWCRHK_R_NOT_LOADED ,"not loaded"}, -{HWCRHK_R_NO_CALLBACK ,"no callback"}, -{HWCRHK_R_NO_KEY ,"no key"}, -{HWCRHK_R_PRIVATE_KEY_ALGORITHMS_DISABLED,"private key algorithms disabled"}, -{HWCRHK_R_REQUEST_FAILED ,"request failed"}, -{HWCRHK_R_REQUEST_FALLBACK ,"request fallback"}, -{HWCRHK_R_UNIT_FAILURE ,"unit failure"}, +{ERR_REASON(HWCRHK_R_ALREADY_LOADED) ,"already loaded"}, +{ERR_REASON(HWCRHK_R_BIO_WAS_FREED) ,"bio was freed"}, +{ERR_REASON(HWCRHK_R_CHIL_ERROR) ,"chil error"}, +{ERR_REASON(HWCRHK_R_CTRL_COMMAND_NOT_IMPLEMENTED),"ctrl command not implemented"}, +{ERR_REASON(HWCRHK_R_DSO_FAILURE) ,"dso failure"}, +{ERR_REASON(HWCRHK_R_LOCKING_MISSING) ,"locking missing"}, +{ERR_REASON(HWCRHK_R_MISSING_KEY_COMPONENTS),"missing key components"}, +{ERR_REASON(HWCRHK_R_NOT_INITIALISED) ,"not initialised"}, +{ERR_REASON(HWCRHK_R_NOT_LOADED) ,"not loaded"}, +{ERR_REASON(HWCRHK_R_NO_CALLBACK) ,"no callback"}, +{ERR_REASON(HWCRHK_R_NO_KEY) ,"no key"}, +{ERR_REASON(HWCRHK_R_PRIVATE_KEY_ALGORITHMS_DISABLED),"private key algorithms disabled"}, +{ERR_REASON(HWCRHK_R_REQUEST_FAILED) ,"request failed"}, +{ERR_REASON(HWCRHK_R_REQUEST_FALLBACK) ,"request fallback"}, +{ERR_REASON(HWCRHK_R_UNIT_FAILURE) ,"unit failure"}, {0,NULL} }; diff --git a/engines/e_nuron_err.c b/engines/e_nuron_err.c index 739529a1fa..9a7864f42f 100644 --- a/engines/e_nuron_err.c +++ b/engines/e_nuron_err.c @@ -1,6 +1,6 @@ -/* hw_nuron_err.c */ +/* e_nuron_err.c */ /* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2005 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 @@ -64,23 +64,27 @@ /* BEGIN ERROR CODES */ #ifndef OPENSSL_NO_ERR + +#define ERR_FUNC(func) ERR_PACK(0,func,0) +#define ERR_REASON(reason) ERR_PACK(0,0,reason) + static ERR_STRING_DATA NURON_str_functs[]= { -{ERR |