diff options
author | markus <> | 2004-04-07 20:42:07 +0000 |
---|---|---|
committer | markus <> | 2004-04-07 20:42:07 +0000 |
commit | 58c08aa241f168c84ce7cc3052454ea59a44eada (patch) | |
tree | 1806747a3fda66041a998ca63c763fdcf722450e /src/lib/libcrypto/engine | |
parent | 9c1aa44a1eacea897c0432e796b205b8484ff4d2 (diff) | |
download | openbsd-58c08aa241f168c84ce7cc3052454ea59a44eada.tar.gz openbsd-58c08aa241f168c84ce7cc3052454ea59a44eada.tar.bz2 openbsd-58c08aa241f168c84ce7cc3052454ea59a44eada.zip |
import openssl-0.9.7d
Diffstat (limited to 'src/lib/libcrypto/engine')
-rw-r--r-- | src/lib/libcrypto/engine/eng_ctrl.c | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/engine/eng_fat.c | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/engine/engine.h | 27 |
3 files changed, 25 insertions, 18 deletions
diff --git a/src/lib/libcrypto/engine/eng_ctrl.c b/src/lib/libcrypto/engine/eng_ctrl.c index ad3858395b..412c73fb0f 100644 --- a/src/lib/libcrypto/engine/eng_ctrl.c +++ b/src/lib/libcrypto/engine/eng_ctrl.c | |||
@@ -160,15 +160,19 @@ static int int_ctrl_helper(ENGINE *e, int cmd, long i, void *p, void (*f)()) | |||
160 | case ENGINE_CTRL_GET_NAME_LEN_FROM_CMD: | 160 | case ENGINE_CTRL_GET_NAME_LEN_FROM_CMD: |
161 | return strlen(e->cmd_defns[idx].cmd_name); | 161 | return strlen(e->cmd_defns[idx].cmd_name); |
162 | case ENGINE_CTRL_GET_NAME_FROM_CMD: | 162 | case ENGINE_CTRL_GET_NAME_FROM_CMD: |
163 | return sprintf(s, "%s", e->cmd_defns[idx].cmd_name); | 163 | return BIO_snprintf(s,strlen(e->cmd_defns[idx].cmd_name) + 1, |
164 | "%s", e->cmd_defns[idx].cmd_name); | ||
164 | case ENGINE_CTRL_GET_DESC_LEN_FROM_CMD: | 165 | case ENGINE_CTRL_GET_DESC_LEN_FROM_CMD: |
165 | if(e->cmd_defns[idx].cmd_desc) | 166 | if(e->cmd_defns[idx].cmd_desc) |
166 | return strlen(e->cmd_defns[idx].cmd_desc); | 167 | return strlen(e->cmd_defns[idx].cmd_desc); |
167 | return strlen(int_no_description); | 168 | return strlen(int_no_description); |
168 | case ENGINE_CTRL_GET_DESC_FROM_CMD: | 169 | case ENGINE_CTRL_GET_DESC_FROM_CMD: |
169 | if(e->cmd_defns[idx].cmd_desc) | 170 | if(e->cmd_defns[idx].cmd_desc) |
170 | return sprintf(s, "%s", e->cmd_defns[idx].cmd_desc); | 171 | return BIO_snprintf(s, |
171 | return sprintf(s, "%s", int_no_description); | 172 | strlen(e->cmd_defns[idx].cmd_desc) + 1, |
173 | "%s", e->cmd_defns[idx].cmd_desc); | ||
174 | return BIO_snprintf(s, strlen(int_no_description) + 1,"%s", | ||
175 | int_no_description); | ||
172 | case ENGINE_CTRL_GET_CMD_FLAGS: | 176 | case ENGINE_CTRL_GET_CMD_FLAGS: |
173 | return e->cmd_defns[idx].cmd_flags; | 177 | return e->cmd_defns[idx].cmd_flags; |
174 | } | 178 | } |
diff --git a/src/lib/libcrypto/engine/eng_fat.c b/src/lib/libcrypto/engine/eng_fat.c index 0d7dae00b2..7ccf7022ee 100644 --- a/src/lib/libcrypto/engine/eng_fat.c +++ b/src/lib/libcrypto/engine/eng_fat.c | |||
@@ -107,14 +107,14 @@ static int int_def_cb(const char *alg, int len, void *arg) | |||
107 | } | 107 | } |
108 | 108 | ||
109 | 109 | ||
110 | int ENGINE_set_default_string(ENGINE *e, const char *list) | 110 | int ENGINE_set_default_string(ENGINE *e, const char *def_list) |
111 | { | 111 | { |
112 | unsigned int flags = 0; | 112 | unsigned int flags = 0; |
113 | if (!CONF_parse_list(list, ',', 1, int_def_cb, &flags)) | 113 | if (!CONF_parse_list(def_list, ',', 1, int_def_cb, &flags)) |
114 | { | 114 | { |
115 | ENGINEerr(ENGINE_F_ENGINE_SET_DEFAULT_STRING, | 115 | ENGINEerr(ENGINE_F_ENGINE_SET_DEFAULT_STRING, |
116 | ENGINE_R_INVALID_STRING); | 116 | ENGINE_R_INVALID_STRING); |
117 | ERR_add_error_data(2, "str=",list); | 117 | ERR_add_error_data(2, "str=",def_list); |
118 | return 0; | 118 | return 0; |
119 | } | 119 | } |
120 | return ENGINE_set_default(e, flags); | 120 | return ENGINE_set_default(e, flags); |
diff --git a/src/lib/libcrypto/engine/engine.h b/src/lib/libcrypto/engine/engine.h index 9c3ab182d3..900f75ce8d 100644 --- a/src/lib/libcrypto/engine/engine.h +++ b/src/lib/libcrypto/engine/engine.h | |||
@@ -513,7 +513,7 @@ ENGINE *ENGINE_get_digest_engine(int nid); | |||
513 | * structure will have had its reference count up'd so the caller | 513 | * structure will have had its reference count up'd so the caller |
514 | * should still free their own reference 'e'. */ | 514 | * should still free their own reference 'e'. */ |
515 | int ENGINE_set_default_RSA(ENGINE *e); | 515 | int ENGINE_set_default_RSA(ENGINE *e); |
516 | int ENGINE_set_default_string(ENGINE *e, const char *list); | 516 | int ENGINE_set_default_string(ENGINE *e, const char *def_list); |
517 | /* Same for the other "methods" */ | 517 | /* Same for the other "methods" */ |
518 | int ENGINE_set_default_DSA(ENGINE *e); | 518 | int ENGINE_set_default_DSA(ENGINE *e); |
519 | int ENGINE_set_default_DH(ENGINE *e); | 519 | int ENGINE_set_default_DH(ENGINE *e); |
@@ -616,17 +616,20 @@ typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id, | |||
616 | const dynamic_fns *fns); | 616 | const dynamic_fns *fns); |
617 | #define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ | 617 | #define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ |
618 | int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ | 618 | int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ |
619 | if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \ | 619 | if (ERR_get_implementation() != fns->err_fns) \ |
620 | fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \ | 620 | { \ |
621 | return 0; \ | 621 | if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \ |
622 | CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \ | 622 | fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \ |
623 | CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \ | 623 | return 0; \ |
624 | CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_cb); \ | 624 | CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \ |
625 | CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \ | 625 | CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \ |
626 | CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destroy_cb); \ | 626 | CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_cb); \ |
627 | if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \ | 627 | CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \ |
628 | return 0; \ | 628 | CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destroy_cb); \ |
629 | if(!ERR_set_implementation(fns->err_fns)) return 0; \ | 629 | if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \ |
630 | return 0; \ | ||
631 | if(!ERR_set_implementation(fns->err_fns)) return 0; \ | ||
632 | } \ | ||
630 | if(!fn(e,id)) return 0; \ | 633 | if(!fn(e,id)) return 0; \ |
631 | return 1; } | 634 | return 1; } |
632 | 635 | ||