From e3f1223fe4571be546484efc664e2b2debb72f25 Mon Sep 17 00:00:00 2001 From: Geoff Thorpe Date: Wed, 18 Apr 2001 00:43:23 +0000 Subject: [PATCH] This moves string constants out of vendor headers and into C files. --- crypto/engine/hw_atalla.c | 13 +++++++++++++ crypto/engine/hw_ubsec.c | 19 +++++++++++++++++++ crypto/engine/vendor_defns/atalla.h | 13 ------------- crypto/engine/vendor_defns/hw_ubsec.h | 21 --------------------- 4 files changed, 32 insertions(+), 34 deletions(-) diff --git a/crypto/engine/hw_atalla.c b/crypto/engine/hw_atalla.c index 84105516ee..37066eb808 100644 --- a/crypto/engine/hw_atalla.c +++ b/crypto/engine/hw_atalla.c @@ -215,6 +215,19 @@ static tfnASI_GetHardwareConfig *p_Atalla_GetHardwareConfig = NULL; static tfnASI_RSAPrivateKeyOpFn *p_Atalla_RSAPrivateKeyOpFn = NULL; static tfnASI_GetPerformanceStatistics *p_Atalla_GetPerformanceStatistics = NULL; +/* These are the static string constants for the DSO file name and the function + * symbol names to bind to. Regrettably, the DSO name on *nix appears to be + * "atasi.so" rather than something more consistent like "libatasi.so". At the + * time of writing, I'm not sure what the file name on win32 is but clearly + * native name translation is not possible (eg libatasi.so on *nix, and + * atasi.dll on win32). For the purposes of testing, I have created a symbollic + * link called "libatasi.so" so that we can use native name-translation - a + * better solution will be needed. */ +static const char *ATALLA_LIBNAME = "atasi"; +static const char *ATALLA_F1 = "ASI_GetHardwareConfig"; +static const char *ATALLA_F2 = "ASI_RSAPrivateKeyOpFn"; +static const char *ATALLA_F3 = "ASI_GetPerformanceStatistics"; + /* (de)initialisation functions. */ static int atalla_init(void) { diff --git a/crypto/engine/hw_ubsec.c b/crypto/engine/hw_ubsec.c index 5168558121..e8766e7506 100644 --- a/crypto/engine/hw_ubsec.c +++ b/crypto/engine/hw_ubsec.c @@ -231,6 +231,25 @@ static t_UBSEC_dsa_verify_ioctl *p_UBSEC_dsa_verify_ioctl = NULL; static t_UBSEC_math_accelerate_ioctl *p_UBSEC_math_accelerate_ioctl = NULL; static t_UBSEC_rng_ioctl *p_UBSEC_rng_ioctl = NULL; +/* + * These are the static string constants for the DSO file name and the function + * symbol names to bind to. + */ + +static const char *UBSEC_LIBNAME = "ubsec"; +static const char *UBSEC_F1 = "ubsec_bytes_to_bits"; +static const char *UBSEC_F2 = "ubsec_bits_to_bytes"; +static const char *UBSEC_F3 = "ubsec_open"; +static const char *UBSEC_F4 = "ubsec_close"; +static const char *UBSEC_F5 = "diffie_hellman_generate_ioctl"; +static const char *UBSEC_F6 = "diffie_hellman_agree_ioctl"; +static const char *UBSEC_F7 = "rsa_mod_exp_ioctl"; +static const char *UBSEC_F8 = "rsa_mod_exp_crt_ioctl"; +static const char *UBSEC_F9 = "dsa_sign_ioctl"; +static const char *UBSEC_F10 = "dsa_verify_ioctl"; +static const char *UBSEC_F11 = "math_accelerate_ioctl"; +static const char *UBSEC_F12 = "rng_ioctl"; + /* (de)initialisation functions. */ static int ubsec_init() { diff --git a/crypto/engine/vendor_defns/atalla.h b/crypto/engine/vendor_defns/atalla.h index 8111649c54..149970d441 100644 --- a/crypto/engine/vendor_defns/atalla.h +++ b/crypto/engine/vendor_defns/atalla.h @@ -46,16 +46,3 @@ typedef int tfnASI_RSAPrivateKeyOpFn(RSAPrivateKey * rsaKey, unsigned char *input, unsigned int modulus_len); -/* These are the static string constants for the DSO file name and the function - * symbol names to bind to. Regrettably, the DSO name on *nix appears to be - * "atasi.so" rather than something more consistent like "libatasi.so". At the - * time of writing, I'm not sure what the file name on win32 is but clearly - * native name translation is not possible (eg libatasi.so on *nix, and - * atasi.dll on win32). For the purposes of testing, I have created a symbollic - * link called "libatasi.so" so that we can use native name-translation - a - * better solution will be needed. */ -static const char *ATALLA_LIBNAME = "atasi"; -static const char *ATALLA_F1 = "ASI_GetHardwareConfig"; -static const char *ATALLA_F2 = "ASI_RSAPrivateKeyOpFn"; -static const char *ATALLA_F3 = "ASI_GetPerformanceStatistics"; - diff --git a/crypto/engine/vendor_defns/hw_ubsec.h b/crypto/engine/vendor_defns/hw_ubsec.h index 0785b47f82..37c830c1e8 100644 --- a/crypto/engine/vendor_defns/hw_ubsec.h +++ b/crypto/engine/vendor_defns/hw_ubsec.h @@ -97,24 +97,3 @@ typedef int t_UBSEC_math_accelerate_ioctl(int fd, ubsec_MathCommand_t command, typedef int t_UBSEC_rng_ioctl(int fd, ubsec_RNGCommand_t command, unsigned char *Result, int *Result_len); - -/* - * These are the static string constants for the DSO file name and the function - * symbol names to bind to. - */ - -#define UBSEC_LIBNAME "ubsec" - -#define UBSEC_F1 "ubsec_bytes_to_bits" -#define UBSEC_F2 "ubsec_bits_to_bytes" -#define UBSEC_F3 "ubsec_open" -#define UBSEC_F4 "ubsec_close" -#define UBSEC_F5 "diffie_hellman_generate_ioctl" -#define UBSEC_F6 "diffie_hellman_agree_ioctl" -#define UBSEC_F7 "rsa_mod_exp_ioctl" -#define UBSEC_F8 "rsa_mod_exp_crt_ioctl" -#define UBSEC_F9 "dsa_sign_ioctl" -#define UBSEC_F10 "dsa_verify_ioctl" -#define UBSEC_F11 "math_accelerate_ioctl" -#define UBSEC_F12 "rng_ioctl" - -- 2.25.1