diff options
author | Ben Laurie <ben@openssl.org> | 2008-06-04 11:01:43 +0000 |
---|---|---|
committer | Ben Laurie <ben@openssl.org> | 2008-06-04 11:01:43 +0000 |
commit | 5ce278a77bd7d23bcf965cfa37afb7b937c1a17d (patch) | |
tree | a69f3fe7e5a7e222cdd1e9314e671ffbcf79fc27 /crypto/evp/pmeth_lib.c | |
parent | 37cf49a3df4b0094c5d335008705518e93b2dad2 (diff) |
More type-checking.
Diffstat (limited to 'crypto/evp/pmeth_lib.c')
-rw-r--r-- | crypto/evp/pmeth_lib.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c index 764271a36d..8b6647a91d 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -68,7 +68,9 @@ #include "evp_locl.h" typedef int sk_cmp_fn_type(const char * const *a, const char * const *b); -STACK *app_pkey_methods = NULL; + +DECLARE_STACK_OF(EVP_PKEY_METHOD); +STACK_OF(EVP_PKEY_METHOD) *app_pkey_methods = NULL; extern const EVP_PKEY_METHOD rsa_pkey_meth, dh_pkey_meth, dsa_pkey_meth; extern const EVP_PKEY_METHOD ec_pkey_meth, hmac_pkey_meth; @@ -95,10 +97,9 @@ const EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type) if (app_pkey_methods) { int idx; - idx = sk_find(app_pkey_methods, (char *)&tmp); + idx = sk_EVP_PKEY_METHOD_find(app_pkey_methods, &tmp); if (idx >= 0) - return (EVP_PKEY_METHOD *) - sk_value(app_pkey_methods, idx); + return sk_EVP_PKEY_METHOD_value(app_pkey_methods, idx); } ret = (EVP_PKEY_METHOD **) OBJ_bsearch((char *)&t, (char *)standard_methods, @@ -279,13 +280,13 @@ int EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth) { if (app_pkey_methods == NULL) { - app_pkey_methods = sk_new((sk_cmp_fn_type *)pmeth_cmp); + app_pkey_methods = sk_EVP_PKEY_METHOD_new(pmeth_cmp); if (!app_pkey_methods) return 0; } - if (!sk_push(app_pkey_methods, (char *)pmeth)) + if (!sk_EVP_PKEY_METHOD_push(app_pkey_methods, pmeth)) return 0; - sk_sort(app_pkey_methods); + sk_EVP_PKEY_METHOD_sort(app_pkey_methods); return 1; } |