From 1e26a8baedbc74036ada80deb16296e7d4eedb18 Mon Sep 17 00:00:00 2001 From: Geoff Thorpe Date: Sun, 16 Mar 2008 21:05:46 +0000 Subject: Fix a variety of warnings generated by some elevated compiler-fascism, OPENSSL_NO_DEPRECATED, etc. Steve, please double-check the CMS stuff... --- crypto/cms/cms_asn1.c | 2 +- crypto/cms/cms_dd.c | 2 +- crypto/cms/cms_enc.c | 4 ++-- crypto/cms/cms_env.c | 3 ++- crypto/cms/cms_lib.c | 4 ++-- crypto/cms/cms_sd.c | 8 ++++---- 6 files changed, 12 insertions(+), 11 deletions(-) (limited to 'crypto/cms') diff --git a/crypto/cms/cms_asn1.c b/crypto/cms/cms_asn1.c index d6363deb37..e5af9a0686 100644 --- a/crypto/cms/cms_asn1.c +++ b/crypto/cms/cms_asn1.c @@ -306,7 +306,7 @@ static int cms_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg) { ASN1_STREAM_ARG *sarg = exarg; - CMS_ContentInfo *cms; + CMS_ContentInfo *cms = NULL; if (pval) cms = (CMS_ContentInfo *)*pval; else diff --git a/crypto/cms/cms_dd.c b/crypto/cms/cms_dd.c index a927caad8e..e3da7555b7 100644 --- a/crypto/cms/cms_dd.c +++ b/crypto/cms/cms_dd.c @@ -121,7 +121,7 @@ int cms_DigestedData_do_final(CMS_ContentInfo *cms, BIO *chain, int verify) if (verify) { - if (mdlen != dd->digest->length) + if (mdlen != (unsigned int)dd->digest->length) { CMSerr(CMS_F_CMS_DIGESTEDDATA_DO_FINAL, CMS_R_MESSAGEDIGEST_WRONG_LENGTH); diff --git a/crypto/cms/cms_enc.c b/crypto/cms/cms_enc.c index f96c46f4e6..fad756e37a 100644 --- a/crypto/cms/cms_enc.c +++ b/crypto/cms/cms_enc.c @@ -151,7 +151,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) goto err; keep_key = 1; } - else if (ec->keylen != EVP_CIPHER_CTX_key_length(ctx)) + else if (ec->keylen != (unsigned int)EVP_CIPHER_CTX_key_length(ctx)) { /* If necessary set key length */ if (EVP_CIPHER_CTX_set_key_length(ctx, ec->keylen) <= 0) @@ -200,7 +200,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) return NULL; } -int cms_EncryptedContent_init(CMS_EncryptedContentInfo *ec, +static int cms_EncryptedContent_init(CMS_EncryptedContentInfo *ec, const EVP_CIPHER *cipher, const unsigned char *key, size_t keylen) { diff --git a/crypto/cms/cms_env.c b/crypto/cms/cms_env.c index 39ebe5a0f1..796b0d3756 100644 --- a/crypto/cms/cms_env.c +++ b/crypto/cms/cms_env.c @@ -118,7 +118,7 @@ int CMS_RecipientInfo_type(CMS_RecipientInfo *ri) /* Add a recipient certificate. For now only handle key transport. * If we ever handle key agreement will need updating. */ - +#if 0 /* currently unused/undeclared */ CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, X509 *recip, unsigned int flags) { @@ -208,6 +208,7 @@ CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, return NULL; } +#endif int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri, EVP_PKEY **pk, X509 **recip, diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c index 7b118b8d98..a8cefd06b7 100644 --- a/crypto/cms/cms_lib.c +++ b/crypto/cms/cms_lib.c @@ -414,7 +414,7 @@ int cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain, } } -STACK_OF(CMS_CertificateChoices) **cms_get0_certificate_choices(CMS_ContentInfo *cms) +static STACK_OF(CMS_CertificateChoices) **cms_get0_certificate_choices(CMS_ContentInfo *cms) { switch (OBJ_obj2nid(cms->contentType)) { @@ -492,7 +492,7 @@ int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert) return r; } -STACK_OF(CMS_RevocationInfoChoice) **cms_get0_revocation_choices(CMS_ContentInfo *cms) +static STACK_OF(CMS_RevocationInfoChoice) **cms_get0_revocation_choices(CMS_ContentInfo *cms) { switch (OBJ_obj2nid(cms->contentType)) { diff --git a/crypto/cms/cms_sd.c b/crypto/cms/cms_sd.c index dc8e896e71..4483593f86 100644 --- a/crypto/cms/cms_sd.c +++ b/crypto/cms/cms_sd.c @@ -451,7 +451,7 @@ CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms, } -int CMS_add1_signingTime(CMS_SignerInfo *si, ASN1_TIME *t) +static int cms_add1_signingTime(CMS_SignerInfo *si, ASN1_TIME *t) { ASN1_TIME *tt; int r = 0; @@ -608,7 +608,7 @@ void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk, X509 **signer, *psig = si->signatureAlgorithm; } -int cms_SignerInfo_content_sign(CMS_SignerInfo *si, BIO *chain) +static int cms_SignerInfo_content_sign(CMS_SignerInfo *si, BIO *chain) { EVP_MD_CTX mctx; int r = 0; @@ -699,7 +699,7 @@ int CMS_SignerInfo_sign(CMS_SignerInfo *si) if (CMS_signed_get_attr_by_NID(si, NID_pkcs9_signingTime, -1) < 0) { - if (!CMS_add1_signingTime(si, NULL)) + if (!cms_add1_signingTime(si, NULL)) goto err; } @@ -856,7 +856,7 @@ int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain) CMS_R_UNABLE_TO_FINALIZE_CONTEXT); goto err; } - if (mlen != os->length) + if (mlen != (unsigned int)os->length) { CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH); -- cgit v1.2.3