From 777c47acbeecf9602cc465864c9f5f2c609c989d Mon Sep 17 00:00:00 2001 From: Ben Laurie Date: Mon, 28 Aug 2006 17:01:04 +0000 Subject: [PATCH] Make things static that should be. Declare stuff in headers that should be. Fix warnings. --- crypto/dsa/dsa_ameth.c | 2 +- crypto/engine/engine.h | 4 ++++ crypto/engine/tb_asnmth.c | 2 +- crypto/evp/evp.h | 4 ++++ crypto/evp/m_sigver.c | 5 +++-- crypto/objects/objects.h | 3 +++ crypto/pkcs7/pk7_doit.c | 4 ++-- crypto/rsa/rsa_locl.h | 4 ++++ crypto/rsa/rsa_pmeth.c | 6 +----- crypto/rsa/rsa_sign.c | 10 ++++++---- ssl/ssl_ciph.c | 2 +- 11 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 crypto/rsa/rsa_locl.h diff --git a/crypto/dsa/dsa_ameth.c b/crypto/dsa/dsa_ameth.c index 371d5afc17..b38099175c 100644 --- a/crypto/dsa/dsa_ameth.c +++ b/crypto/dsa/dsa_ameth.c @@ -417,7 +417,7 @@ static void update_buflen(const BIGNUM *b, size_t *pbuflen) *pbuflen = i; } -int do_dsa_print(BIO *bp, const DSA *x, int off, int ptype) +static int do_dsa_print(BIO *bp, const DSA *x, int off, int ptype) { unsigned char *m=NULL; int ret=0; diff --git a/crypto/engine/engine.h b/crypto/engine/engine.h index 9a2eb68646..eda9752f54 100644 --- a/crypto/engine/engine.h +++ b/crypto/engine/engine.h @@ -391,6 +391,10 @@ int ENGINE_register_pkey_meths(ENGINE *e); void ENGINE_unregister_pkey_meths(ENGINE *e); void ENGINE_register_all_pkey_meths(void); +int ENGINE_register_pkey_asn1_meths(ENGINE *e); +void ENGINE_unregister_pkey_asn1_meths(ENGINE *e); +void ENGINE_register_all_pkey_asn1_meths(void); + /* These functions register all support from the above categories. Note, use of * these functions can result in static linkage of code your application may not * need. If you only need a subset of functionality, consider using more diff --git a/crypto/engine/tb_asnmth.c b/crypto/engine/tb_asnmth.c index 8aaaf004f5..b3a4fd533c 100644 --- a/crypto/engine/tb_asnmth.c +++ b/crypto/engine/tb_asnmth.c @@ -87,7 +87,7 @@ int ENGINE_register_pkey_asn1_meths(ENGINE *e) return 1; } -void ENGINE_register_all_pkey_asn1_meths() +void ENGINE_register_all_pkey_asn1_meths(void) { ENGINE *e; diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index 585cb17d1d..f89dedac9e 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -876,6 +876,10 @@ int PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, const unsigned char *salt, int saltlen, int iter, int keylen, unsigned char *out); +int PKCS5_PBKDF2_HMAC(const char *pass, int passlen, + const unsigned char *salt, int saltlen, int iter, + const EVP_MD *digest, + int keylen, unsigned char *out); int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, ASN1_TYPE *param, const EVP_CIPHER *cipher, const EVP_MD *md, int en_de); diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c index 95382118b2..fd4fe349c5 100644 --- a/crypto/evp/m_sigver.c +++ b/crypto/evp/m_sigver.c @@ -62,8 +62,9 @@ #include #include -int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, - const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey, int ver) +static int do_sigver_init(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, + const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey, + int ver) { if (!EVP_DigestInit_ex(ctx, type, e)) return 0; diff --git a/crypto/objects/objects.h b/crypto/objects/objects.h index 5270f9925b..7d8cdc97c3 100644 --- a/crypto/objects/objects.h +++ b/crypto/objects/objects.h @@ -1027,6 +1027,9 @@ int OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid); int OBJ_add_sigid(int signid, int dig_id, int pkey_id); void OBJ_sigid_free(void); +extern int obj_cleanup_defer; +void check_defer(int nid); + /* BEGIN ERROR CODES */ /* The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. diff --git a/crypto/pkcs7/pk7_doit.c b/crypto/pkcs7/pk7_doit.c index 095661805e..6577e368a8 100644 --- a/crypto/pkcs7/pk7_doit.c +++ b/crypto/pkcs7/pk7_doit.c @@ -197,8 +197,8 @@ static int pkcs7_encode_rinfo(PKCS7_RECIP_INFO *ri, } -int pkcs7_decrypt_rinfo(unsigned char **pek, int *peklen, - PKCS7_RECIP_INFO *ri, EVP_PKEY *pkey) +static int pkcs7_decrypt_rinfo(unsigned char **pek, int *peklen, + PKCS7_RECIP_INFO *ri, EVP_PKEY *pkey) { EVP_PKEY_CTX *pctx = NULL; unsigned char *ek = NULL; diff --git a/crypto/rsa/rsa_locl.h b/crypto/rsa/rsa_locl.h new file mode 100644 index 0000000000..48ebfa3816 --- /dev/null +++ b/crypto/rsa/rsa_locl.h @@ -0,0 +1,4 @@ +extern int int_rsa_verify(int dtype, const unsigned char *m, size_t m_len, + unsigned char *rm, size_t *prm_len, + const unsigned char *sigbuf, size_t siglen, + RSA *rsa); diff --git a/crypto/rsa/rsa_pmeth.c b/crypto/rsa/rsa_pmeth.c index 5887c4f233..98a8ce44c3 100644 --- a/crypto/rsa/rsa_pmeth.c +++ b/crypto/rsa/rsa_pmeth.c @@ -63,11 +63,7 @@ #include #include #include "evp_locl.h" - -extern int int_rsa_verify(int dtype, const unsigned char *m, size_t m_len, - unsigned char *rm, size_t *prm_len, - const unsigned char *sigbuf, size_t siglen, - RSA *rsa); +#include "rsa_locl.h" /* RSA pkey context structure */ diff --git a/crypto/rsa/rsa_sign.c b/crypto/rsa/rsa_sign.c index 7dae5c8415..e5a015d1a6 100644 --- a/crypto/rsa/rsa_sign.c +++ b/crypto/rsa/rsa_sign.c @@ -62,6 +62,7 @@ #include #include #include +#include "rsa_locl.h" /* Size of an SSL signature: MD5+SHA1 */ #define SSL_SIG_LENGTH 36 @@ -142,10 +143,11 @@ int RSA_sign(int type, const unsigned char *m, unsigned int m_len, return(ret); } -int int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, - unsigned char *rm, unsigned int *prm_len, - const unsigned char *sigbuf, unsigned int siglen, - RSA *rsa) +int int_rsa_verify(int dtype, const unsigned char *m, + unsigned int m_len, + unsigned char *rm, unsigned int *prm_len, + const unsigned char *sigbuf, unsigned int siglen, + RSA *rsa) { int i,ret=0,sigtype; unsigned char *s; diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index 47393c0591..c85ea030fe 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -803,7 +803,7 @@ static int ssl_cipher_process_rulestr(const char *rule_str, unsigned long algorithms, mask, algo_strength, mask_strength; const char *l, *start, *buf; int j, multi, found, rule, retval, ok, buflen; - unsigned long cipher_id; + unsigned long cipher_id = 0; char ch; retval = 1; -- 2.34.1