diff options
author | Rich Salz <rsalz@openssl.org> | 2017-06-07 15:12:03 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-06-07 15:12:03 -0400 |
commit | 52df25cf2e656146cb3b206d8220124f0417d03f (patch) | |
tree | a0502334c45d96ad9ab32a855ee5bea28df2191d /engines | |
parent | be606c013d31847718ceb5d97c567988a771c2e5 (diff) | |
download | openssl-52df25cf2e656146cb3b206d8220124f0417d03f.tar.gz |
make error tables const and separate header file
Run perltidy on util/mkerr
Change some mkerr flags, write some doc comments
Make generated tables "const" when genearting lib-internal ones.
Add "state" file for mkerr
Renerate error tables and headers
Rationalize declaration of ERR_load_XXX_strings
Fix out-of-tree build
Add -static; sort flags/vars for options.
Also tweak code output
Moved engines/afalg to engines (from master)
Use -static flag
Standard engine #include's of errors
Don't linewrap err string tables unless necessary
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3392)
Diffstat (limited to 'engines')
-rw-r--r-- | engines/build.info | 4 | ||||
-rw-r--r-- | engines/e_afalg.c | 4 | ||||
-rw-r--r-- | engines/e_afalg.ec | 4 | ||||
-rw-r--r-- | engines/e_afalg.txt | 18 | ||||
-rw-r--r-- | engines/e_afalg_err.c | 114 | ||||
-rw-r--r-- | engines/e_afalg_err.h | 49 | ||||
-rw-r--r-- | engines/e_capi.ec | 4 | ||||
-rw-r--r-- | engines/e_capi.txt | 50 | ||||
-rw-r--r-- | engines/e_capi.txt.old | 50 | ||||
-rw-r--r-- | engines/e_capi_err.c | 180 | ||||
-rw-r--r-- | engines/e_capi_err.h | 95 | ||||
-rw-r--r-- | engines/e_dasync.c | 1 | ||||
-rw-r--r-- | engines/e_dasync.ec | 4 | ||||
-rw-r--r-- | engines/e_dasync.txt | 12 | ||||
-rw-r--r-- | engines/e_dasync.txt.old | 12 | ||||
-rw-r--r-- | engines/e_dasync_err.c | 91 | ||||
-rw-r--r-- | engines/e_dasync_err.h | 39 | ||||
-rw-r--r-- | engines/e_ossltest.c | 1 | ||||
-rw-r--r-- | engines/e_ossltest.ec | 4 | ||||
-rw-r--r-- | engines/e_ossltest.txt | 3 | ||||
-rw-r--r-- | engines/e_ossltest.txt.old | 3 | ||||
-rw-r--r-- | engines/e_ossltest_err.c | 69 | ||||
-rw-r--r-- | engines/e_ossltest_err.h | 35 | ||||
-rw-r--r-- | engines/e_padlock.ec | 1 |
24 files changed, 418 insertions, 429 deletions
diff --git a/engines/build.info b/engines/build.info index 2f0c54a0bc..d74d3807b6 100644 --- a/engines/build.info +++ b/engines/build.info @@ -8,7 +8,7 @@ IF[{- !$disabled{"engine"} -}] SOURCE[../libcrypto]=e_capi.c ENDIF IF[{- !$disabled{afalgeng} -}] - SOURCE[../libcrypto]=e_afalg.c e_afalg_err.c + SOURCE[../libcrypto]=e_afalg.c ENDIF ELSE ENGINES=padlock @@ -23,7 +23,7 @@ IF[{- !$disabled{"engine"} -}] ENDIF IF[{- !$disabled{afalgeng} -}] ENGINES=afalg - SOURCE[afalg]=e_afalg.c e_afalg_err.c + SOURCE[afalg]=e_afalg.c DEPEND[afalg]=../libcrypto INCLUDE[afalg]= ../include ENDIF diff --git a/engines/e_afalg.c b/engines/e_afalg.c index 5ce9047105..7e682554ed 100644 --- a/engines/e_afalg.c +++ b/engines/e_afalg.c @@ -45,9 +45,7 @@ void engine_load_afalg_int(void) # include <errno.h> # include "e_afalg.h" - -# define AFALG_LIB_NAME "AFALG" -# include "e_afalg_err.h" +# include "e_afalg_err.c" # ifndef SOL_ALG # define SOL_ALG 279 diff --git a/engines/e_afalg.ec b/engines/e_afalg.ec index 2d14d6597d..6d7420fe5c 100644 --- a/engines/e_afalg.ec +++ b/engines/e_afalg.ec @@ -1 +1,3 @@ -L AFALG e_afalg_err.h e_afalg_err.c +# The INPUT HEADER is scanned for declarations +# LIBNAME INPUT HEADER ERROR-TABLE FILE +L AFALG e_afalg_err.h e_afalg_err.c diff --git a/engines/e_afalg.txt b/engines/e_afalg.txt new file mode 100644 index 0000000000..4f304762fc --- /dev/null +++ b/engines/e_afalg.txt @@ -0,0 +1,18 @@ +AFALG_F_AFALG_CHK_PLATFORM 100 +AFALG_F_AFALG_CREATE_SK 101 +AFALG_F_AFALG_INIT_AIO 102 +AFALG_F_AFALG_SETUP_ASYNC_EVENT_NOTIFICATION 103 +AFALG_F_AFALG_SET_KEY 104 +AFALG_F_BIND_AFALG 105 +AFALG_R_EVENTFD_FAILED 108 +AFALG_R_FAILED_TO_GET_PLATFORM_INFO 111 +AFALG_R_INIT_FAILED 100 +AFALG_R_IO_SETUP_FAILED 105 +AFALG_R_KERNEL_DOES_NOT_SUPPORT_AFALG 101 +AFALG_R_KERNEL_DOES_NOT_SUPPORT_ASYNC_AFALG 107 +AFALG_R_MEM_ALLOC_FAILED 102 +AFALG_R_SOCKET_ACCEPT_FAILED 110 +AFALG_R_SOCKET_BIND_FAILED 103 +AFALG_R_SOCKET_CREATE_FAILED 109 +AFALG_R_SOCKET_OPERATION_FAILED 104 +AFALG_R_SOCKET_SET_KEY_FAILED 106 diff --git a/engines/e_afalg_err.c b/engines/e_afalg_err.c index ca394edb7b..18fe9c34e0 100644 --- a/engines/e_afalg_err.c +++ b/engines/e_afalg_err.c @@ -1,5 +1,6 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -7,105 +8,76 @@ * https://www.openssl.org/source/license.html */ -/* - * NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file, - * only reason strings will be preserved. - */ - -#include <stdio.h> #include <openssl/err.h> #include "e_afalg_err.h" -/* 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 AFALG_str_functs[] = { - {ERR_FUNC(AFALG_F_AFALG_CHK_PLATFORM), "afalg_chk_platform"}, - {ERR_FUNC(AFALG_F_AFALG_CREATE_BIND_SK), "afalg_create_bind_sk"}, - {ERR_FUNC(AFALG_F_AFALG_CREATE_BIND_SOCKET), "afalg_create_bind_sk"}, - {ERR_FUNC(AFALG_F_AFALG_CREATE_SK), "afalg_create_sk"}, - {ERR_FUNC(AFALG_F_AFALG_INIT_AIO), "afalg_init_aio"}, - {ERR_FUNC(AFALG_F_AFALG_SETUP_ASYNC_EVENT_NOTIFICATION), + {ERR_PACK(0, AFALG_F_AFALG_CHK_PLATFORM, 0), "afalg_chk_platform"}, + {ERR_PACK(0, AFALG_F_AFALG_CREATE_SK, 0), "afalg_create_sk"}, + {ERR_PACK(0, AFALG_F_AFALG_INIT_AIO, 0), "afalg_init_aio"}, + {ERR_PACK(0, AFALG_F_AFALG_SETUP_ASYNC_EVENT_NOTIFICATION, 0), "afalg_setup_async_event_notification"}, - {ERR_FUNC(AFALG_F_AFALG_SET_KEY), "afalg_set_key"}, - {ERR_FUNC(AFALG_F_AFALG_SOCKET), "afalg_socket"}, - {ERR_FUNC(AFALG_F_AFALG_START_CIPHER_SK), "afalg_start_cipher_sk"}, - {ERR_FUNC(AFALG_F_BIND_AFALG), "bind_afalg"}, + {ERR_PACK(0, AFALG_F_AFALG_SET_KEY, 0), "afalg_set_key"}, + {ERR_PACK(0, AFALG_F_BIND_AFALG, 0), "bind_afalg"}, {0, NULL} }; static ERR_STRING_DATA AFALG_str_reasons[] = { - {ERR_REASON(AFALG_R_EVENTFD_FAILED), "eventfd failed"}, - {ERR_REASON(AFALG_R_FAILED_TO_GET_PLATFORM_INFO), - "failed to get platform info"}, - {ERR_REASON(AFALG_R_INIT_FAILED), "init failed"}, - {ERR_REASON(AFALG_R_IO_SETUP_FAILED), "io setup failed"}, - {ERR_REASON(AFALG_R_KERNEL_DOES_NOT_SUPPORT_AFALG), - "kernel does not support afalg"}, - {ERR_REASON(AFALG_R_KERNEL_DOES_NOT_SUPPORT_ASYNC_AFALG), - "kernel does not support async afalg"}, - {ERR_REASON(AFALG_R_MEM_ALLOC_FAILED), "mem alloc failed"}, - {ERR_REASON(AFALG_R_SOCKET_ACCEPT_FAILED), "socket accept failed"}, - {ERR_REASON(AFALG_R_SOCKET_BIND_FAILED), "socket bind failed"}, - {ERR_REASON(AFALG_R_SOCKET_CREATE_FAILED), "socket create failed"}, - {ERR_REASON(AFALG_R_SOCKET_OPERATION_FAILED), "socket operation failed"}, - {ERR_REASON(AFALG_R_SOCKET_SET_KEY_FAILED), "socket set key failed"}, + {ERR_PACK(0, 0, AFALG_R_EVENTFD_FAILED), "eventfd failed"}, + {ERR_PACK(0, 0, AFALG_R_FAILED_TO_GET_PLATFORM_INFO), + "failed to get platform info"}, + {ERR_PACK(0, 0, AFALG_R_INIT_FAILED), "init failed"}, + {ERR_PACK(0, 0, AFALG_R_IO_SETUP_FAILED), "io setup failed"}, + {ERR_PACK(0, 0, AFALG_R_KERNEL_DOES_NOT_SUPPORT_AFALG), + "kernel does not support afalg"}, + {ERR_PACK(0, 0, AFALG_R_KERNEL_DOES_NOT_SUPPORT_ASYNC_AFALG), + "kernel does not support async afalg"}, + {ERR_PACK(0, 0, AFALG_R_MEM_ALLOC_FAILED), "mem alloc failed"}, + {ERR_PACK(0, 0, AFALG_R_SOCKET_ACCEPT_FAILED), "socket accept failed"}, + {ERR_PACK(0, 0, AFALG_R_SOCKET_BIND_FAILED), "socket bind failed"}, + {ERR_PACK(0, 0, AFALG_R_SOCKET_CREATE_FAILED), "socket create failed"}, + {ERR_PACK(0, 0, AFALG_R_SOCKET_OPERATION_FAILED), + "socket operation failed"}, + {ERR_PACK(0, 0, AFALG_R_SOCKET_SET_KEY_FAILED), "socket set key failed"}, {0, NULL} }; #endif -#ifdef AFALG_LIB_NAME -static ERR_STRING_DATA AFALG_lib_name[] = { - {0, AFALG_LIB_NAME}, - {0, NULL} -}; -#endif - -static int AFALG_lib_error_code = 0; -static int AFALG_error_init = 1; +static int lib_code = 0; +static int error_loaded = 0; -void ERR_load_AFALG_strings(void) +static int ERR_load_AFALG_strings(void) { - if (AFALG_lib_error_code == 0) - AFALG_lib_error_code = ERR_get_next_error_library(); + if (lib_code == 0) + lib_code = ERR_get_next_error_library(); - if (AFALG_error_init) { - AFALG_error_init = 0; + if (!error_loaded) { #ifndef OPENSSL_NO_ERR - ERR_load_strings(AFALG_lib_error_code, AFALG_str_functs); - ERR_load_strings(AFALG_lib_error_code, AFALG_str_reasons); -#endif - -#ifdef AFALG_LIB_NAME - AFALG_lib_name->error = ERR_PACK(AFALG_lib_error_code, 0, 0); - ERR_load_strings(0, AFALG_lib_name); + ERR_load_strings(lib_code, AFALG_str_functs); + ERR_load_strings(lib_code, AFALG_str_reasons); #endif + error_loaded = 1; } + return 1; } -void ERR_unload_AFALG_strings(void) +static void ERR_unload_AFALG_strings(void) { - if (AFALG_error_init == 0) { + if (error_loaded) { #ifndef OPENSSL_NO_ERR - ERR_unload_strings(AFALG_lib_error_code, AFALG_str_functs); - ERR_unload_strings(AFALG_lib_error_code, AFALG_str_reasons); -#endif - -#ifdef AFALG_LIB_NAME - ERR_unload_strings(0, AFALG_lib_name); + ERR_unload_strings(lib_code, AFALG_str_functs); + ERR_unload_strings(lib_code, AFALG_str_reasons); #endif - AFALG_error_init = 1; + error_loaded = 0; } } -void ERR_AFALG_error(int function, int reason, char *file, int line) +static void ERR_AFALG_error(int function, int reason, char *file, int line) { - if (AFALG_lib_error_code == 0) - AFALG_lib_error_code = ERR_get_next_error_library(); - ERR_PUT_error(AFALG_lib_error_code, function, reason, file, line); + if (lib_code == 0) + lib_code = ERR_get_next_error_library(); + ERR_PUT_error(lib_code, function, reason, file, line); } diff --git a/engines/e_afalg_err.h b/engines/e_afalg_err.h index 21abc979c6..3eb1332bbf 100644 --- a/engines/e_afalg_err.h +++ b/engines/e_afalg_err.h @@ -1,5 +1,6 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -7,40 +8,25 @@ * https://www.openssl.org/source/license.html */ -/* - * NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file, - * only reason strings will be preserved. - */ - -#ifndef HEADER_AFALG_ERR_H -# define HEADER_AFALG_ERR_H +#ifndef HEADER_AFALGERR_H +# define HEADER_AFALGERR_H -# ifdef __cplusplus -extern "C" { -# endif +# define AFALGerr(f, r) ERR_AFALG_error((f), (r), OPENSSL_FILE, OPENSSL_LINE) -/* BEGIN ERROR CODES */ -void ERR_load_AFALG_strings(void); -void ERR_unload_AFALG_strings(void); -void ERR_AFALG_error(int function, int reason, char *file, int line); -# define AFALGerr(f,r) ERR_AFALG_error((f),(r),__FILE__,__LINE__) -/* Error codes for the AFALG functions. */ - -/* Function codes. */ +/* + * AFALG function codes. + */ # define AFALG_F_AFALG_CHK_PLATFORM 100 -# define AFALG_F_AFALG_CREATE_BIND_SK 106 -# define AFALG_F_AFALG_CREATE_BIND_SOCKET 105 -# define AFALG_F_AFALG_CREATE_SK 108 -# define AFALG_F_AFALG_INIT_AIO 101 -# define AFALG_F_AFALG_SETUP_ASYNC_EVENT_NOTIFICATION 107 -# define AFALG_F_AFALG_SET_KEY 109 -# define AFALG_F_AFALG_SOCKET 102 -# define AFALG_F_AFALG_START_CIPHER_SK 103 -# define AFALG_F_BIND_AFALG 104 +# define AFALG_F_AFALG_CREATE_SK 101 +# define AFALG_F_AFALG_INIT_AIO 102 +# define AFALG_F_AFALG_SETUP_ASYNC_EVENT_NOTIFICATION 103 +# define AFALG_F_AFALG_SET_KEY 104 +# define AFALG_F_BIND_AFALG 105 -/* Reason codes. */ +/* + * AFALG reason codes. + */ # define AFALG_R_EVENTFD_FAILED 108 # define AFALG_R_FAILED_TO_GET_PLATFORM_INFO 111 # define AFALG_R_INIT_FAILED 100 @@ -54,7 +40,4 @@ void ERR_AFALG_error(int function, int reason, char *file, int line); # define AFALG_R_SOCKET_OPERATION_FAILED 104 # define AFALG_R_SOCKET_SET_KEY_FAILED 106 -#ifdef __cplusplus -} -#endif #endif diff --git a/engines/e_capi.ec b/engines/e_capi.ec index d2ad668a98..d9c7aa510f 100644 --- a/engines/e_capi.ec +++ b/engines/e_capi.ec @@ -1 +1,3 @@ -L CAPI e_capi_err.h e_capi_err.c +# The INPUT HEADER is scanned for declarations +# LIBNAME INPUT HEADER ERROR-TABLE FILE +L CAPI e_capi_err.h e_capi_err.c diff --git a/engines/e_capi.txt b/engines/e_capi.txt new file mode 100644 index 0000000000..6444a069f6 --- /dev/null +++ b/engines/e_capi.txt @@ -0,0 +1,50 @@ +CAPI_F_CAPI_CERT_GET_FNAME 99 +CAPI_F_CAPI_CTRL 100 +CAPI_F_CAPI_CTX_NEW 101 +CAPI_F_CAPI_CTX_SET_PROVNAME 102 +CAPI_F_CAPI_DSA_DO_SIGN 114 +CAPI_F_CAPI_GET_KEY 103 +CAPI_F_CAPI_GET_PKEY 115 +CAPI_F_CAPI_GET_PROVNAME 104 +CAPI_F_CAPI_GET_PROV_INFO 105 +CAPI_F_CAPI_INIT 106 +CAPI_F_CAPI_LIST_CONTAINERS 107 +CAPI_F_CAPI_LOAD_PRIVKEY 108 +CAPI_F_CAPI_OPEN_STORE 109 +CAPI_F_CAPI_RSA_PRIV_DEC 110 +CAPI_F_CAPI_RSA_PRIV_ENC 111 +CAPI_F_CAPI_RSA_SIGN 112 +CAPI_F_CAPI_VTRACE 118 +CAPI_F_CERT_SELECT_DIALOG 117 +CAPI_F_CLIENT_CERT_SELECT 116 +CAPI_F_WIDE_TO_ASC 113 +CAPI_R_CANT_CREATE_HASH_OBJECT 100 +CAPI_R_CANT_FIND_CAPI_CONTEXT 101 +CAPI_R_CANT_GET_KEY 102 +CAPI_R_CANT_SET_HASH_VALUE 103 +CAPI_R_CRYPTACQUIRECONTEXT_ERROR 104 +CAPI_R_CRYPTENUMPROVIDERS_ERROR 105 +CAPI_R_DECRYPT_ERROR 106 +CAPI_R_ENGINE_NOT_INITIALIZED 107 +CAPI_R_ENUMCONTAINERS_ERROR 108 +CAPI_R_ERROR_ADDING_CERT 109 +CAPI_R_ERROR_CREATING_STORE 110 +CAPI_R_ERROR_GETTING_FRIENDLY_NAME 111 +CAPI_R_ERROR_GETTING_KEY_PROVIDER_INFO 112 +CAPI_R_ERROR_OPENING_STORE 113 +CAPI_R_ERROR_SIGNING_HASH 114 +CAPI_R_FILE_OPEN_ERROR 115 +CAPI_R_FUNCTION_NOT_SUPPORTED 116 +CAPI_R_GETUSERKEY_ERROR 117 +CAPI_R_INVALID_DIGEST_LENGTH 118 +CAPI_R_INVALID_DSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER 119 +CAPI_R_INVALID_LOOKUP_METHOD 120 +CAPI_R_INVALID_PUBLIC_KEY_BLOB 121 +CAPI_R_INVALID_RSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER 122 +CAPI_R_PUBKEY_EXPORT_ERROR 123 +CAPI_R_PUBKEY_EXPORT_LENGTH_ERROR 124 +CAPI_R_UNKNOWN_COMMAND 125 +CAPI_R_UNSUPPORTED_ALGORITHM_NID 126 +CAPI_R_UNSUPPORTED_PADDING 127 +CAPI_R_UNSUPPORTED_PUBLIC_KEY_ALGORITHM 128 +CAPI_R_WIN32_ERROR 129 diff --git a/engines/e_capi.txt.old b/engines/e_capi.txt.old new file mode 100644 index 0000000000..6444a069f6 --- /dev/null +++ b/engines/e_capi.txt.old @@ -0,0 +1,50 @@ +CAPI_F_CAPI_CERT_GET_FNAME 99 +CAPI_F_CAPI_CTRL 100 +CAPI_F_CAPI_CTX_NEW 101 +CAPI_F_CAPI_CTX_SET_PROVNAME 102 +CAPI_F_CAPI_DSA_DO_SIGN 114 +CAPI_F_CAPI_GET_KEY 103 +CAPI_F_CAPI_GET_PKEY 115 +CAPI_F_CAPI_GET_PROVNAME 104 +CAPI_F_CAPI_GET_PROV_INFO 105 +CAPI_F_CAPI_INIT 106 +CAPI_F_CAPI_LIST_CONTAINERS 107 +CAPI_F_CAPI_LOAD_PRIVKEY 108 +CAPI_F_CAPI_OPEN_STORE 109 +CAPI_F_CAPI_RSA_PRIV_DEC 110 +CAPI_F_CAPI_RSA_PRIV_ENC 111 +CAPI_F_CAPI_RSA_SIGN 112 +CAPI_F_CAPI_VTRACE 118 +CAPI_F_CERT_SELECT_DIALOG 117 +CAPI_F_CLIENT_CERT_SELECT 116 +CAPI_F_WIDE_TO_ASC 113 +CAPI_R_CANT_CREATE_HASH_OBJECT 100 +CAPI_R_CANT_FIND_CAPI_CONTEXT 101 +CAPI_R_CANT_GET_KEY 102 +CAPI_R_CANT_SET_HASH_VALUE 103 +CAPI_R_CRYPTACQUIRECONTEXT_ERROR 104 +CAPI_R_CRYPTENUMPROVIDERS_ERROR 105 +CAPI_R_DECRYPT_ERROR 106 +CAPI_R_ENGINE_NOT_INITIALIZED 107 +CAPI_R_ENUMCONTAINERS_ERROR 108 +CAPI_R_ERROR_ADDING_CERT 109 +CAPI_R_ERROR_CREATING_STORE 110 +CAPI_R_ERROR_GETTING_FRIENDLY_NAME 111 +CAPI_R_ERROR_GETTING_KEY_PROVIDER_INFO 112 +CAPI_R_ERROR_OPENING_STORE 113 +CAPI_R_ERROR_SIGNING_HASH 114 +CAPI_R_FILE_OPEN_ERROR 115 +CAPI_R_FUNCTION_NOT_SUPPORTED 116 +CAPI_R_GETUSERKEY_ERROR 117 +CAPI_R_INVALID_DIGEST_LENGTH 118 +CAPI_R_INVALID_DSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER 119 +CAPI_R_INVALID_LOOKUP_METHOD 120 +CAPI_R_INVALID_PUBLIC_KEY_BLOB 121 +CAPI_R_INVALID_RSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER 122 +CAPI_R_PUBKEY_EXPORT_ERROR 123 +CAPI_R_PUBKEY_EXPORT_LENGTH_ERROR 124 +CAPI_R_UNKNOWN_COMMAND 125 +CAPI_R_UNSUPPORTED_ALGORITHM_NID 126 +CAPI_R_UNSUPPORTED_PADDING 127 +CAPI_R_UNSUPPORTED_PUBLIC_KEY_ALGORITHM 128 +CAPI_R_WIN32_ERROR 129 diff --git a/engines/e_capi_err.c b/engines/e_capi_err.c index 64e963a5eb..23bcc093e4 100644 --- a/engines/e_capi_err.c +++ b/engines/e_capi_err.c @@ -1,5 +1,6 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -7,137 +8,112 @@ * https://www.openssl.org/source/license.html */ -/* - * NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file, - * only reason strings will be preserved. - */ - -#include <stdio.h> #include <openssl/err.h> #include "e_capi_err.h" -/* 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 CAPI_str_functs[] = { - {ERR_FUNC(CAPI_F_CAPI_CERT_GET_FNAME), "CAPI_CERT_GET_FNAME"}, - {ERR_FUNC(CAPI_F_CAPI_CTRL), "CAPI_CTRL"}, - {ERR_FUNC(CAPI_F_CAPI_CTX_NEW), "CAPI_CTX_NEW"}, - {ERR_FUNC(CAPI_F_CAPI_CTX_SET_PROVNAME), "CAPI_CTX_SET_PROVNAME"}, - {ERR_FUNC(CAPI_F_CAPI_DSA_DO_SIGN), "CAPI_DSA_DO_SIGN"}, - {ERR_FUNC(CAPI_F_CAPI_GET_KEY), "CAPI_GET_KEY"}, - {ERR_FUNC(CAPI_F_CAPI_GET_PKEY), "CAPI_GET_PKEY"}, - {ERR_FUNC(CAPI_F_CAPI_GET_PROVNAME), "CAPI_GET_PROVNAME"}, - {ERR_FUNC(CAPI_F_CAPI_GET_PROV_INFO), "CAPI_GET_PROV_INFO"}, - {ERR_FUNC(CAPI_F_CAPI_INIT), "CAPI_INIT"}, - {ERR_FUNC(CAPI_F_CAPI_LIST_CONTAINERS), "CAPI_LIST_CONTAINERS"}, - {ERR_FUNC(CAPI_F_CAPI_LOAD_PRIVKEY), "CAPI_LOAD_PRIVKEY"}, - {ERR_FUNC(CAPI_F_CAPI_OPEN_STORE), "CAPI_OPEN_STORE"}, - {ERR_FUNC(CAPI_F_CAPI_RSA_PRIV_DEC), "CAPI_RSA_PRIV_DEC"}, - {ERR_FUNC(CAPI_F_CAPI_RSA_PRIV_ENC), "CAPI_RSA_PRIV_ENC"}, - {ERR_FUNC(CAPI_F_CAPI_RSA_SIGN), "CAPI_RSA_SIGN"}, - {ERR_FUNC(CAPI_F_CAPI_VTRACE), "CAPI_VTRACE"}, - {ERR_FUNC(CAPI_F_CERT_SELECT_DIALOG), "CERT_SELECT_DIALOG"}, - {ERR_FUNC(CAPI_F_CLIENT_CERT_SELECT), "CLIENT_CERT_SELECT"}, - {ERR_FUNC(CAPI_F_WIDE_TO_ASC), "WIDE_TO_ASC"}, + {ERR_PACK(0, CAPI_F_CAPI_CERT_GET_FNAME, 0), "capi_cert_get_fname"}, + {ERR_PACK(0, CAPI_F_CAPI_CTRL, 0), "capi_ctrl"}, + {ERR_PACK(0, CAPI_F_CAPI_CTX_NEW, 0), "capi_ctx_new"}, + {ERR_PACK(0, CAPI_F_CAPI_CTX_SET_PROVNAME, 0), "capi_ctx_set_provname"}, + {ERR_PACK(0, CAPI_F_CAPI_DSA_DO_SIGN, 0), "capi_dsa_do_sign"}, + {ERR_PACK(0, CAPI_F_CAPI_GET_KEY, 0), "capi_get_key"}, + {ERR_PACK(0, CAPI_F_CAPI_GET_PKEY, 0), "capi_get_pkey"}, + {ERR_PACK(0, CAPI_F_CAPI_GET_PROVNAME, 0), "capi_get_provname"}, + {ERR_PACK(0, CAPI_F_CAPI_GET_PROV_INFO, 0), "capi_get_prov_info"}, + {ERR_PACK(0, CAPI_F_CAPI_INIT, 0), "capi_init"}, + {ERR_PACK(0, CAPI_F_CAPI_LIST_CONTAINERS, 0), "capi_list_containers"}, + {ERR_PACK(0, CAPI_F_CAPI_LOAD_PRIVKEY, 0), "capi_load_privkey"}, + {ERR_PACK(0, CAPI_F_CAPI_OPEN_STORE, 0), "capi_open_store"}, + {ERR_PACK(0, CAPI_F_CAPI_RSA_PRIV_DEC, 0), "capi_rsa_priv_dec"}, + {ERR_PACK(0, CAPI_F_CAPI_RSA_PRIV_ENC, 0), "capi_rsa_priv_enc"}, + {ERR_PACK(0, CAPI_F_CAPI_RSA_SIGN, 0), "capi_rsa_sign"}, + {ERR_PACK(0, CAPI_F_CAPI_VTRACE, 0), "capi_vtrace"}, + {ERR_PACK(0, CAPI_F_CERT_SELECT_DIALOG, 0), "cert_select_dialog"}, + {ERR_PACK(0, CAPI_F_CLIENT_CERT_SELECT, 0), "CLIENT_CERT_SELECT"}, + {ERR_PACK(0, CAPI_F_WIDE_TO_ASC, 0), "wide_to_asc"}, {0, NULL} }; static ERR_STRING_DATA CAPI_str_reasons[] = { - {ERR_REASON(CAPI_R_CANT_CREATE_HASH_OBJECT), "cant create hash object"}, - {ERR_REASON(CAPI_R_CANT_FIND_CAPI_CONTEXT), "cant find capi context"}, - {ERR_REASON(CAPI_R_CANT_GET_KEY), "cant get key"}, - {ERR_REASON(CAPI_R_CANT_SET_HASH_VALUE), "cant set hash value"}, - {ERR_REASON(CAPI_R_CRYPTACQUIRECONTEXT_ERROR), - "cryptacquirecontext error"}, - {ERR_REASON(CAPI_R_CRYPTENUMPROVIDERS_ERROR), "cryptenumproviders error"}, - {ERR_REASON(CAPI_R_DECRYPT_ERROR), "decrypt error"}, - {ERR_REASON(CAPI_R_ENGINE_NOT_INITIALIZED), "engine not initialized"}, - {ERR_REASON(CAPI_R_ENUMCONTAINERS_ERROR), "enumcontainers error"}, - {ERR_REASON(CAPI_R_ERROR_ADDING_CERT), "error adding cert"}, - {ERR_REASON(CAPI_R_ERROR_CREATING_STORE), "error creating store"}, - {ERR_REASON(CAPI_R_ERROR_GETTING_FRIENDLY_NAME), - "error getting friendly name"}, - {ERR_REASON(CAPI_R_ERROR_GETTING_KEY_PROVIDER_INFO), - "error getting key provider info"}, - {ERR_REASON(CAPI_R_ERROR_OPENING_STORE), "error opening store"}, - {ERR_REASON(CAPI_R_ERROR_SIGNING_HASH), "error signing hash"}, - {ERR_REASON(CAPI_R_FILE_OPEN_ERROR), "file open error"}, - {ERR_REASON(CAPI_R_FUNCTION_NOT_SUPPORTED), "function not supported"}, - {ERR_REASON(CAPI_R_GETUSERKEY_ERROR), "getuserkey error"}, - {ERR_REASON(CAPI_R_INVALID_DIGEST_LENGTH), "invalid digest length"}, - {ERR_REASON(CAPI_R_INVALID_DSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER), - "invalid dsa public key blob magic number"}, - {ERR_REASON(CAPI_R_INVALID_LOOKUP_METHOD), "invalid lookup method"}, - {ERR_REASON(CAPI_R_INVALID_PUBLIC_KEY_BLOB), "invalid public key blob"}, - {ERR_REASON(CAPI_R_INVALID_RSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER), - "invalid rsa public key blob magic number"}, - {ERR_REASON(CAPI_R_PUBKEY_EXPORT_ERROR), "pubkey export error"}, - {ERR_REASON(CAPI_R_PUBKEY_EXPORT_LENGTH_ERROR), - "pubkey export length error"}, - {ERR_REASON(CAPI_R_UNKNOWN_COMMAND), "unknown command"}, - {ERR_REASON(CAPI_R_UNSUPPORTED_ALGORITHM_NID), - "unsupported algorithm nid"}, - {ERR_REASON(CAPI_R_UNSUPPORTED_PADDING), "unsupported padding"}, - {ERR_REASON(CAPI_R_UNSUPPORTED_PUBLIC_KEY_ALGORITHM), - "unsupported public key algorithm"}, - {ERR_REASON(CAPI_R_WIN32_ERROR), "win32 error"}, + {ERR_PACK(0, 0, CAPI_R_CANT_CREATE_HASH_OBJECT), "cant create hash object"}, + {ERR_PACK(0, 0, CAPI_R_CANT_FIND_CAPI_CONTEXT), "cant find capi context"}, + {ERR_PACK(0, 0, CAPI_R_CANT_GET_KEY), "cant get key"}, + {ERR_PACK(0, 0, CAPI_R_CANT_SET_HASH_VALUE), "cant set hash value"}, + {ERR_PACK(0, 0, CAPI_R_CRYPTACQUIRECONTEXT_ERROR), + "cryptacquirecontext error"}, + {ERR_PACK(0, 0, CAPI_R_CRYPTENUMPROVIDERS_ERROR), + "cryptenumproviders error"}, + {ERR_PACK(0, 0, CAPI_R_DECRYPT_ERROR), "decrypt error"}, + {ERR_PACK(0, 0, CAPI_R_ENGINE_NOT_INITIALIZED), "engine not initialized"}, + {ERR_PACK(0, 0, CAPI_R_ENUMCONTAINERS_ERROR), "enumcontainers error"}, + {ERR_PACK(0, 0, CAPI_R_ERROR_ADDING_CERT), "error adding cert"}, + {ERR_PACK(0, 0, CAPI_R_ERROR_CREATING_STORE), "error creating store"}, + {ERR_PACK(0, 0, CAPI_R_ERROR_GETTING_FRIENDLY_NAME), + "error getting friendly name"}, + {ERR_PACK(0, 0, CAPI_R_ERROR_GETTING_KEY_PROVIDER_INFO), + "error getting key provider info"}, + {ERR_PACK(0, 0, CAPI_R_ERROR_OPENING_STORE), "error opening store"}, + {ERR_PACK(0, 0, CAPI_R_ERROR_SIGNING_HASH), "error signing hash"}, + {ERR_PACK(0, 0, CAPI_R_FILE_OPEN_ERROR), "file open error"}, + {ERR_PACK(0, 0, CAPI_R_FUNCTION_NOT_SUPPORTED), "function not supported"}, + {ERR_PACK(0, 0, CAPI_R_GETUSERKEY_ERROR), "getuserkey error"}, + {ERR_PACK(0, 0, CAPI_R_INVALID_DIGEST_LENGTH), "invalid digest length"}, + {ERR_PACK(0, 0, CAPI_R_INVALID_DSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER), + "invalid dsa public key blob magic number"}, + {ERR_PACK(0, 0, CAPI_R_INVALID_LOOKUP_METHOD), "invalid lookup method"}, + {ERR_PACK(0, 0, CAPI_R_INVALID_PUBLIC_KEY_BLOB), "invalid public key blob"}, + {ERR_PACK(0, 0, CAPI_R_INVALID_RSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER), + "invalid rsa public key blob magic number"}, + {ERR_PACK(0, 0, CAPI_R_PUBKEY_EXPORT_ERROR), "pubkey export error"}, + {ERR_PACK(0, 0, CAPI_R_PUBKEY_EXPORT_LENGTH_ERROR), + "pubkey export length error"}, + {ERR_PACK(0, 0, CAPI_R_UNKNOWN_COMMAND), "unknown command"}, + {ERR_PACK(0, 0, CAPI_R_UNSUPPORTED_ALGORITHM_NID), + "unsupported algorithm nid"}, + {ERR_PACK(0, 0, CAPI_R_UNSUPPORTED_PADDING), "unsupported padding"}, + {ERR_PACK(0, 0, CAPI_R_UNSUPPORTED_PUBLIC_KEY_ALGORITHM), + "unsupported public key algorithm"}, + {ERR_PACK(0, 0, CAPI_R_WIN32_ERROR), "win32 error"}, {0, NULL} }; #endif -#ifdef CAPI_LIB_NAME -static ERR_STRING_DATA CAPI_lib_name[] = { - {0, CAPI_LIB_NAME}, - {0, NULL} -}; -#endif - -static int CAPI_lib_error_code = 0; -static int CAPI_error_init = 1; +static int lib_code = 0; +static int error_loaded = 0; -static void ERR_load_CAPI_strings(void) +static int ERR_load_CAPI_strings(void) { - if (CAPI_lib_error_code == 0) - CAPI_lib_error_code = ERR_get_next_error_library(); + if (lib_code == 0) + lib_code = ERR_get_next_error_library(); - if (CAPI_error_init) { - CAPI_error_init = 0; + if (!error_loaded) { #ifndef OPENSSL_NO_ERR - ERR_load_strings(CAPI_lib_error_code, CAPI_str_functs); - ERR_load_strings(CAPI_lib_error_code, CAPI_str_reasons); -#endif - -#ifdef CAPI_LIB_NAME - CAPI_lib_name->error = ERR_PACK(CAPI_lib_error_code, 0, 0); - ERR_load_strings(0, CAPI_lib_name); + ERR_load_strings(lib_code, CAPI_str_functs); + ERR_load_strings(lib_code, CAPI_str_reasons); #endif + error_loaded = 1; } + return 1; } static void ERR_unload_CAPI_strings(void) { - if (CAPI_error_init == 0) { + if (error_loaded) { #ifndef OPENSSL_NO_ERR - ERR_unload_strings(CAPI_lib_error_code, CAPI_str_functs); - ERR_unload_strings(CAPI_lib_error_code, CAPI_str_reasons); -#endif - -#ifdef CAPI_LIB_NAME - ERR_unload_strings(0, CAPI_lib_name); + ERR_unload_strings(lib_code, CAPI_str_functs); + ERR_unload_strings(lib_code, CAPI_str_reasons); #endif - CAPI_error_init = 1; + error_loaded = 0; } } static void ERR_CAPI_error(int function, int reason, char *file, int line) { - if (CAPI_lib_error_code == 0) - CAPI_lib_error_code = ERR_get_next_error_library(); - ERR_PUT_error(CAPI_lib_error_code, function, reason, file, line); + if (lib_code == 0) + lib_code = ERR_get_next_error_library(); + ERR_PUT_error(lib_code, function, reason, file, line); } diff --git a/engines/e_capi_err.h b/engines/e_capi_err.h index bbaffada3d..e034c98cae 100644 --- a/engines/e_capi_err.h +++ b/engines/e_capi_err.h @@ -1,5 +1,6 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -7,28 +8,15 @@ * https://www.openssl.org/source/license.html */ -/* - * NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file, - * only reason strings will be preserved. - */ - -#ifndef HEADER_CAPI_ERR_H -# define HEADER_CAPI_ERR_H - -#ifdef __cplusplus -extern "C" { -#endif +#ifndef HEADER_CAPIERR_H +# define HEADER_CAPIERR_H -/* BEGIN ERROR CODES */ -static void ERR_load_CAPI_strings(void); -static void ERR_unload_CAPI_strings(void); -static void ERR_CAPI_error(int function, int reason, char *file, int line); -# define CAPIerr(f,r) ERR_CAPI_error((f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define CAPIerr(f, r) ERR_CAPI_error((f), (r), OPENSSL_FILE, OPENSSL_LINE) -/* Error codes for the CAPI functions. */ -/* Function codes. */ +/* + * CAPI function codes. + */ # define CAPI_F_CAPI_CERT_GET_FNAME 99 # define CAPI_F_CAPI_CTRL 100 # define CAPI_F_CAPI_CTX_NEW 101 @@ -50,39 +38,38 @@ static void ERR_CAPI_error(int function, int reason, char *file, int line); # define CAPI_F_CLIENT_CERT_SELECT 116 # define CAPI_F_WIDE_TO_ASC 113 -/* Reason codes. */ -# define CAPI_R_CANT_CREATE_HASH_OBJECT 99 -# define CAPI_R_CANT_FIND_CAPI_CONTEXT 100 -# define CAPI_R_CANT_GET_KEY 101 -# define CAPI_R_CANT_SET_HASH_VALUE 102 -# define CAPI_R_CRYPTACQUIRECONTEXT_ERROR 103 -# define CAPI_R_CRYPTENUMPROVIDERS_ERROR 104 -# define CAPI_R_DECRYPT_ERROR 105 -# define CAPI_R_ENGINE_NOT_INITIALIZED 106 -# define CAPI_R_ENUMCONTAINERS_ERROR 107 -# define CAPI_R_ERROR_ADDING_CERT 125 -# define CAPI_R_ERROR_CREATING_STORE 126 -# define CAPI_R_ERROR_GETTING_FRIENDLY_NAME 108 -# define CAPI_R_ERROR_GETTING_KEY_PROVIDER_INFO 109 -# define CAPI_R_ERROR_OPENING_STORE 110 -# define CAPI_R_ERROR_SIGNING_HASH 111 -# define CAPI_R_FILE_OPEN_ERROR 128 -# define CAPI_R_FUNCTION_NOT_SUPPORTED 112 -# define CAPI_R_GETUSERKEY_ERROR 113 -# define CAPI_R_INVALID_DIGEST_LENGTH 124 -# define CAPI_R_INVALID_DSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER 122 -# define CAPI_R_INVALID_LOOKUP_METHOD 114 -# define CAPI_R_INVALID_PUBLIC_KEY_BLOB 115 -# define CAPI_R_INVALID_RSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER 123 -# define CAPI_R_PUBKEY_EXPORT_ERROR 116 -# define CAPI_R_PUBKEY_EXPORT_LENGTH_ERROR 117 -# define CAPI_R_UNKNOWN_COMMAND 118 -# define CAPI_R_UNSUPPORTED_ALGORITHM_NID 119 -# define CAPI_R_UNSUPPORTED_PADDING 120 -# define CAPI_R_UNSUPPORTED_PUBLIC_KEY_ALGORITHM 121 -# define CAPI_R_WIN32_ERROR 127 +/* + * CAPI reason codes. + */ +# define CAPI_R_CANT_CREATE_HASH_OBJECT 100 +# define CAPI_R_CANT_FIND_CAPI_CONTEXT 101 +# define CAPI_R_CANT_GET_KEY 102 +# define CAPI_R_CANT_SET_HASH_VALUE 103 +# define CAPI_R_CRYPTACQUIRECONTEXT_ERROR 104 +# define CAPI_R_CRYPTENUMPROVIDERS_ERROR 105 +# define CAPI_R_DECRYPT_ERROR 106 +# define CAPI_R_ENGINE_NOT_INITIALIZED 107 +# define CAPI_R_ENUMCONTAINERS_ERROR 108 +# define CAPI_R_ERROR_ADDING_CERT 109 +# define CAPI_R_ERROR_CREATING_STORE 110 +# define CAPI_R_ERROR_GETTING_FRIENDLY_NAME 111 +# define CAPI_R_ERROR_GETTING_KEY_PROVIDER_INFO 112 +# define CAPI_R_ERROR_OPENING_STORE 113 +# define CAPI_R_ERROR_SIGNING_HASH 114 +# define CAPI_R_FILE_OPEN_ERROR 115 +# define CAPI_R_FUNCTION_NOT_SUPPORTED 116 +# define CAPI_R_GETUSERKEY_ERROR 117 +# define CAPI_R_INVALID_DIGEST_LENGTH 118 +# define CAPI_R_INVALID_DSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER 119 +# define CAPI_R_INVALID_LOOKUP_METHOD 120 +# define CAPI_R_INVALID_PUBLIC_KEY_BLOB 121 +# define CAPI_R_INVALID_RSA_PUBLIC_KEY_BLOB_MAGIC_NUMBER 122 +# define CAPI_R_PUBKEY_EXPORT_ERROR 123 +# define CAPI_R_PUBKEY_EXPORT_LENGTH_ERROR 124 +# define CAPI_R_UNKNOWN_COMMAND 125 +# define CAPI_R_UNSUPPORTED_ALGORITHM_NID 126 +# define CAPI_R_UNSUPPORTED_PADDING 127 +# define CAPI_R_UNSUPPORTED_PUBLIC_KEY_ALGORITHM 128 +# define CAPI_R_WIN32_ERROR 129 -#ifdef __cplusplus -} -#endif #endif diff --git a/engines/e_dasync.c b/engines/e_dasync.c index 4e3e9369fc..9211ab783b 100644 --- a/engines/e_dasync.c +++ b/engines/e_dasync.c @@ -34,7 +34,6 @@ # define ASYNC_WIN #endif -#define DASYNC_LIB_NAME "DASYNC" #include "e_dasync_err.c" /* Engine Id and Name */ diff --git a/engines/e_dasync.ec b/engines/e_dasync.ec index 385faa0b62..3d56ebcc5f 100644 --- a/engines/e_dasync.ec +++ b/engines/e_dasync.ec @@ -1 +1,3 @@ -L DASYNC e_dasync_err.h e_dasync_err.c +# The INPUT HEADER is scanned for declarations +# LIBNAME INPUT HEADER ERROR-TABLE FILE +L DASYNC e_dasync_err.h e_dasync_err.c diff --git a/engines/e_dasync.txt b/engines/e_dasync.txt new file mode 100644 index 0000000000..05f359d49e --- /dev/null +++ b/engines/e_dasync.txt @@ -0,0 +1,12 @@ +DASYNC_F_BIND_DASYNC 107 +DASYNC_F_CIPHER_AES_128_CBC_CODE 100 +DASYNC_F_DASYNC_AES128_CBC_HMAC_SHA1_INIT_KEY 109 +DASYNC_F_DASYNC_AES128_INIT_KEY 108 +DASYNC_F_DASYNC_BN_MOD_EXP 101 +DASYNC_F_DASYNC_CIPHER_INIT_KEY_HELPER 110 +DASYNC_F_DASYNC_MOD_EXP 102 +DASYNC_F_DASYNC_PRIVATE_DECRYPT 103 +DASYNC_F_DASYNC_PRIVATE_ENCRYPT 104 +DASYNC_F_DASYNC_PUBLIC_DECRYPT 105 +DASYNC_F_DASYNC_PUBLIC_ENCRYPT 106 +DASYNC_R_INIT_FAILED 100 diff --git a/engines/e_dasync.txt.old b/engines/e_dasync.txt.old new file mode 100644 index 0000000000..05f359d49e --- /dev/null +++ b/engines/e_dasync.txt.old @@ -0,0 +1,12 @@ +DASYNC_F_BIND_DASYNC 107 +DASYNC_F_CIPHER_AES_128_CBC_CODE 100 +DASYNC_F_DASYNC_AES128_CBC_HMAC_SHA1_INIT_KEY 109 +DASYNC_F_DASYNC_AES128_INIT_KEY 108 +DASYNC_F_DASYNC_BN_MOD_EXP 101 +DASYNC_F_DASYNC_CIPHER_INIT_KEY_HELPER 110 +DASYNC_F_DASYNC_MOD_EXP 102 +DASYNC_F_DASYNC_PRIVATE_DECRYPT 103 +DASYNC_F_DASYNC_PRIVATE_ENCRYPT 104 +DASYNC_F_DASYNC_PUBLIC_DECRYPT 105 +DASYNC_F_DASYNC_PUBLIC_ENCRYPT 106 +DASYNC_R_INIT_FAILED 100 diff --git a/engines/e_dasync_err.c b/engines/e_dasync_err.c index a9e7765314..6f14e12ff9 100644 --- a/engines/e_dasync_err.c +++ b/engines/e_dasync_err.c @@ -1,5 +1,6 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -7,96 +8,68 @@ * https://www.openssl.org/source/license.html */ -/* - * NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file, - * only reason strings will be preserved. - */ - -#include <stdio.h> #include <openssl/err.h> #include "e_dasync_err.h" -/* 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 DASYNC_str_functs[] = { - {ERR_FUNC(DASYNC_F_BIND_DASYNC), "bind_dasync"}, - {ERR_FUNC(DASYNC_F_CIPHER_AES_128_CBC_CODE), "CIPHER_AES_128_CBC_CODE"}, - {ERR_FUNC(DASYNC_F_DASYNC_AES128_CBC_HMAC_SHA1_INIT_KEY), + {ERR_PACK(0, DASYNC_F_BIND_DASYNC, 0), "bind_dasync"}, + {ERR_PACK(0, DASYNC_F_CIPHER_AES_128_CBC_CODE, 0), + "CIPHER_AES_128_CBC_CODE"}, + {ERR_PACK(0, DASYNC_F_DASYNC_AES128_CBC_HMAC_SHA1_INIT_KEY, 0), "dasync_aes128_cbc_hmac_sha1_init_key"}, - {ERR_FUNC(DASYNC_F_DASYNC_AES128_INIT_KEY), "dasync_aes128_init_key"}, - {ERR_FUNC(DASYNC_F_DASYNC_BN_MOD_EXP), "DASYNC_BN_MOD_EXP"}, - {ERR_FUNC(DASYNC_F_DASYNC_CIPHER_INIT_KEY_HELPER), + {ERR_PACK(0, DASYNC_F_DASYNC_AES128_INIT_KEY, 0), "dasync_aes128_init_key"}, + {ERR_PACK(0, DASYNC_F_DASYNC_BN_MOD_EXP, 0), "DASYNC_BN_MOD_EXP"}, + {ERR_PACK(0, DASYNC_F_DASYNC_CIPHER_INIT_KEY_HELPER, 0), "dasync_cipher_init_key_helper"}, - {ERR_FUNC(DASYNC_F_DASYNC_MOD_EXP), "DASYNC_MOD_EXP"}, - {ERR_FUNC(DASYNC_F_DASYNC_PRIVATE_DECRYPT), "DASYNC_PRIVATE_DECRYPT"}, - {ERR_FUNC(DASYNC_F_DASYNC_PRIVATE_ENCRYPT), "DASYNC_PRIVATE_ENCRYPT"}, - {ERR_FUNC(DASYNC_F_DASYNC_PUBLIC_DECRYPT), "DASYNC_PUBLIC_DECRYPT"}, - {ERR_FUNC(DASYNC_F_DASYNC_PUBLIC_ENCRYPT), "DASYNC_PUBLIC_ENCRYPT"}, + {ERR_PACK(0, DASYNC_F_DASYNC_MOD_EXP, 0), "DASYNC_MOD_EXP"}, + {ERR_PACK(0, DASYNC_F_DASYNC_PRIVATE_DECRYPT, 0), "DASYNC_PRIVATE_DECRYPT"}, + {ERR_PACK(0, DASYNC_F_DASYNC_PRIVATE_ENCRYPT, 0), "DASYNC_PRIVATE_ENCRYPT"}, + {ERR_PACK(0, DASYNC_F_DASYNC_PUBLIC_DECRYPT, 0), "DASYNC_PUBLIC_DECRYPT"}, + {ERR_PACK(0, DASYNC_F_DASYNC_PUBLIC_ENCRYPT, 0), "DASYNC_PUBLIC_ENCRYPT"}, {0, NULL} }; static ERR_STRING_DATA DASYNC_str_reasons[] = { - {ERR_REASON(DASYNC_R_INIT_FAILED), "init failed"}, - {ERR_REASON(DASYNC_R_LENGTH_NOT_BLOCK_ALIGNED), - "length not block aligned"}, - {ERR_REASON(DASYNC_R_UNKNOWN_FAULT), "unknown fault"}, + {ERR_PACK(0, 0, DASYNC_R_INIT_FAILED), "init failed"}, {0, NULL} }; #endif -#ifdef DASYNC_LIB_NAME -static ERR_STRING_DATA DASYNC_lib_name[] = { - {0, DASYNC_LIB_NAME}, - {0, NULL} -}; -#endif - -static int DASYNC_lib_error_code = 0; -static int DASYNC_error_init = 1; +static int lib_code = 0; +static int error_loaded = 0; -static void ERR_load_DASYNC_strings(void) +static int ERR_load_DASYNC_strings(void) { - if (DASYNC_lib_error_code == 0) - DASYNC_lib_error_code = ERR_get_next_error_library(); + if (lib_code == 0) + lib_code = ERR_get_next_error_library(); - if (DASYNC_error_init) { - DASYNC_error_init = 0; + if (!error_loaded) { #ifndef OPENSSL_NO_ERR - ERR_load_strings(DASYNC_lib_error_code, DASYNC_str_functs); - ERR_load_strings(DASYNC_lib_error_code, DASYNC_str_reasons); -#endif - -#ifdef DASYNC_LIB_NAME - DASYNC_lib_name->error = ERR_PACK(DASYNC_lib_error_code, 0, 0); - ERR_load_strings(0, DASYNC_lib_name); + ERR_load_strings(lib_code, DASYNC_str_functs); + ERR_load_strings(lib_code, DASYNC_str_reasons); #endif + error_loaded = 1; } + return 1; } static void ERR_unload_DASYNC_strings(void) { - if (DASYNC_error_init == 0) { + if (error_loaded) { #ifndef OPENSSL_NO_ERR - ERR_unload_strings(DASYNC_lib_error_code, DASYNC_str_functs); - ERR_unload_strings(DASYNC_lib_error_code, DASYNC_str_reasons); -#endif - -#ifdef DASYNC_LIB_NAME - ERR_unload_strings(0, DASYNC_lib_name); + ERR_unload_strings(lib_code, DASYNC_str_functs); + ERR_unload_strings(lib_code, DASYNC_str_reasons); #endif - DASYNC_error_init = 1; + error_loaded = 0; } } static void ERR_DASYNC_error(int function, int reason, char *file, int line) { - if (DASYNC_lib_error_code == 0) - DASYNC_lib_error_code = ERR_get_next_error_library(); - ERR_PUT_error(DASYNC_lib_error_code, function, reason, file, line); + if (lib_code == 0) + lib_code = ERR_get_next_error_library(); + ERR_PUT_error(lib_code, function, reason, file, line); } diff --git a/engines/e_dasync_err.h b/engines/e_dasync_err.h index b01fead2ac..7c2c027879 100644 --- a/engines/e_dasync_err.h +++ b/engines/e_dasync_err.h @@ -1,5 +1,6 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -7,28 +8,15 @@ * https://www.openssl.org/source/license.html */ -/* - * NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file, - * only reason strings will be preserved. - */ - -#ifndef HEADER_DASYNC_ERR_H -# define HEADER_DASYNC_ERR_H - -#ifdef __cplusplus -extern "C" { -#endif +#ifndef HEADER_DASYNCERR_H +# define HEADER_DASYNCERR_H -/* BEGIN ERROR CODES */ -static void ERR_load_DASYNC_strings(void); -static void ERR_unload_DASYNC_strings(void); -static void ERR_DASYNC_error(int function, int reason, char *file, int line); -# define DASYNCerr(f,r) ERR_DASYNC_error((f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define DASYNCerr(f, r) ERR_DASYNC_error((f), (r), OPENSSL_FILE, OPENSSL_LINE) -/* Error codes for the DASYNC functions. */ -/* Function codes. */ +/* + * DASYNC function codes. + */ # define DASYNC_F_BIND_DASYNC 107 # define DASYNC_F_CIPHER_AES_128_CBC_CODE 100 # define DASYNC_F_DASYNC_AES128_CBC_HMAC_SHA1_INIT_KEY 109 @@ -41,12 +29,9 @@ static void ERR_DASYNC_error(int function, int reason, char *file, int line); # define DASYNC_F_DASYNC_PUBLIC_DECRYPT 105 # define DASYNC_F_DASYNC_PUBLIC_ENCRYPT 106 -/* Reason codes. */ -# define DASYNC_R_INIT_FAILED 102 -# define DASYNC_R_LENGTH_NOT_BLOCK_ALIGNED 100 -# define DASYNC_R_UNKNOWN_FAULT 101 +/* + * DASYNC reason codes. + */ +# define DASYNC_R_INIT_FAILED 100 -#ifdef __cplusplus -} -#endif #endif diff --git a/engines/e_ossltest.c b/engines/e_ossltest.c index 3c9f08c8ef..ea752d5e9c 100644 --- a/engines/e_ossltest.c +++ b/engines/e_ossltest.c @@ -25,7 +25,6 @@ #include <openssl/aes.h> #include <openssl/crypto.h> -#define OSSLTEST_LIB_NAME "OSSLTEST" #include "e_ossltest_err.c" /* Engine Id and Name */ diff --git a/engines/e_ossltest.ec b/engines/e_ossltest.ec index d8a1befa20..a4a55ecb3f 100644 --- a/engines/e_ossltest.ec +++ b/engines/e_ossltest.ec @@ -1 +1,3 @@ -L OSSLTEST e_ossltest_err.h e_ossltest_err.c +# The INPUT HEADER is scanned for declarations +# LIBNAME INPUT HEADER ERROR-TABLE FILE +L OSSLTEST e_ossltest_err.h e_ossltest_err.c diff --git a/engines/e_ossltest.txt b/engines/e_ossltest.txt new file mode 100644 index 0000000000..e51eb8c100 --- /dev/null +++ b/engines/e_ossltest.txt @@ -0,0 +1,3 @@ +OSSLTEST_F_BIND_OSSLTEST 100 +OSSLTEST_F_OSSLTEST_AES128_INIT_KEY 101 +OSSLTEST_R_INIT_FAILED 100 diff --git a/engines/e_ossltest.txt.old b/engines/e_ossltest.txt.old new file mode 100644 index 0000000000..e51eb8c100 --- /dev/null +++ b/engines/e_ossltest.txt.old @@ -0,0 +1,3 @@ +OSSLTEST_F_BIND_OSSLTEST 100 +OSSLTEST_F_OSSLTEST_AES128_INIT_KEY 101 +OSSLTEST_R_INIT_FAILED 100 diff --git a/engines/e_ossltest_err.c b/engines/e_ossltest_err.c index 71d05788d1..d46c03840b 100644 --- a/engines/e_ossltest_err.c +++ b/engines/e_ossltest_err.c @@ -1,5 +1,6 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -7,83 +8,57 @@ * https://www.openssl.org/source/license.html */ -/* - * NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file, - * only reason strings will be preserved. - */ - -#include <stdio.h> #include <openssl/err.h> #include "e_ossltest_err.h" -/* 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 OSSLTEST_str_functs[] = { - {ERR_FUNC(OSSLTEST_F_BIND_OSSLTEST), "BIND_OSSLTEST"}, - {ERR_FUNC(OSSLTEST_F_OSSLTEST_AES128_INIT_KEY), + {ERR_PACK(0, OSSLTEST_F_BIND_OSSLTEST, 0), "bind_ossltest"}, + {ERR_PACK(0, OSSLTEST_F_OSSLTEST_AES128_INIT_KEY, 0), "OSSLTEST_AES128_INIT_KEY"}, {0, NULL} }; static ERR_STRING_DATA OSSLTEST_str_reasons[] = { - {ERR_REASON(OSSLTEST_R_INIT_FAILED), "init failed"}, + {ERR_PACK(0, 0, OSSLTEST_R_INIT_FAILED), "init failed"}, {0, NULL} }; #endif -#ifdef OSSLTEST_LIB_NAME -static ERR_STRING_DATA OSSLTEST_lib_name[] = { - {0, OSSLTEST_LIB_NAME}, - {0, NULL} -}; -#endif - -static int OSSLTEST_lib_error_code = 0; -static int OSSLTEST_error_init = 1; +static int lib_code = 0; +static int error_loaded = 0; -static void ERR_load_OSSLTEST_strings(void) +static int ERR_load_OSSLTEST_strings(void) { - if (OSSLTEST_lib_error_code == 0) - OSSLTEST_lib_error_code = ERR_get_next_error_library(); + if (lib_code == 0) + lib_code = ERR_get_next_error_library(); - if (OSSLTEST_error_init) { - OSSLTEST_error_init = 0; + if (!error_loaded) { #ifndef OPENSSL_NO_ERR - ERR_load_strings(OSSLTEST_lib_error_code, OSSLTEST_str_functs); - ERR_load_strings(OSSLTEST_lib_error_code, OSSLTEST_str_reasons); -#endif - -#ifdef OSSLTEST_LIB_NAME - OSSLTEST_lib_name->error = ERR_PACK(OSSLTEST_lib_error_code, 0, 0); - ERR_load_strings(0, OSSLTEST_lib_name); + ERR_load_strings(lib_code, OSSLTEST_str_functs); + ERR_load_strings(lib_code, OSSLTEST_str_reasons); #endif + error_loaded = 1; } + return 1; } static void ERR_unload_OSSLTEST_strings(void) { - if (OSSLTEST_error_init == 0) { + if (error_loaded) { #ifndef OPENSSL_NO_ERR - ERR_unload_strings(OSSLTEST_lib_error_code, OSSLTEST_str_functs); - ERR_unload_strings(OSSLTEST_lib_error_code, OSSLTEST_str_reasons); -#endif - -#ifdef OSSLTEST_LIB_NAME - ERR_unload_strings(0, OSSLTEST_lib_name); + ERR_unload_strings(lib_code, OSSLTEST_str_functs); + ERR_unload_strings(lib_code, OSSLTEST_str_reasons); #endif - OSSLTEST_error_init = 1; + error_loaded = 0; } } static void ERR_OSSLTEST_error(int function, int reason, char *file, int line) { - if (OSSLTEST_lib_error_code == 0) - OSSLTEST_lib_error_code = ERR_get_next_error_library(); - ERR_PUT_error(OSSLTEST_lib_error_code, function, reason, file, line); + if (lib_code == 0) + lib_code = ERR_get_next_error_library(); + ERR_PUT_error(lib_code, function, reason, file, line); } diff --git a/engines/e_ossltest_err.h b/engines/e_ossltest_err.h index a323c398f6..e745c1a236 100644 --- a/engines/e_ossltest_err.h +++ b/engines/e_ossltest_err.h @@ -1,5 +1,6 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Generated by util/mkerr.pl DO NOT EDIT + * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -7,35 +8,21 @@ * https://www.openssl.org/source/license.html */ -/* - * NOTE: this file was auto generated by the mkerr.pl script: any changes - * made to it will be overwritten when the script next updates this file, - * only reason strings will be preserved. - */ - -#ifndef HEADER_OSSLTEST_ERR_H -# define HEADER_OSSLTEST_ERR_H - -#ifdef __cplusplus -extern "C" { -#endif +#ifndef HEADER_OSSLTESTERR_H +# define HEADER_OSSLTESTERR_H -/* BEGIN ERROR CODES */ -static void ERR_load_OSSLTEST_strings(void); -static void ERR_unload_OSSLTEST_strings(void); -static void ERR_OSSLTEST_error(int function, int reason, char *file, int line); -# define OSSLTESTerr(f,r) ERR_OSSLTEST_error((f),(r),OPENSSL_FILE,OPENSSL_LINE) +# define OSSLTESTerr(f, r) ERR_OSSLTEST_error((f), (r), OPENSSL_FILE, OPENSSL_LINE) -/* Error codes for the OSSLTEST functions. */ -/* Function codes. */ +/* + * OSSLTEST function codes. + */ # define OSSLTEST_F_BIND_OSSLTEST 100 # define OSSLTEST_F_OSSLTEST_AES128_INIT_KEY 101 -/* Reason codes. */ +/* + * OSSLTEST reason codes. + */ # define OSSLTEST_R_INIT_FAILED 100 -#ifdef __cplusplus -} -#endif #endif diff --git a/engines/e_padlock.ec b/engines/e_padlock.ec deleted file mode 100644 index 5c8a1d26a5..0000000000 --- a/engines/e_padlock.ec +++ /dev/null @@ -1 +0,0 @@ -L PADLOCK e_padlock_err.h e_padlock_err.c |