OPENSSL_NO_DEPRECATED, etc. Steve, please double-check the CMS stuff...
#include <time.h>
#include "apps.h" /* needs to be included before the openssl headers! */
#include <openssl/e_os2.h>
+#include <openssl/crypto.h>
+#include <openssl/err.h>
#include <openssl/ssl.h>
#include <openssl/evp.h>
+#include <openssl/bn.h>
#if defined(NETWARE_CLIB)
# ifdef NETWARE_BSDSOCK
#include <openssl/pem.h>
#include <openssl/rand.h>
#include <openssl/ocsp.h>
+#include <openssl/bn.h>
#include "s_apps.h"
#include "timeouts.h"
#include <openssl/pem.h>
#include <openssl/rand.h>
#include <openssl/ts.h>
+#include <openssl/bn.h>
#undef PROG
#define PROG ts_main
#include <openssl/buffer.h>
#include <openssl/asn1.h>
#include <openssl/objects.h>
+#include <openssl/bn.h>
int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp)
{
BIOerr(BIO_F_BIO_NEW_MEM_BUF,BIO_R_NULL_PARAMETER);
return NULL;
}
- sz = (len<0) ? strlen(buf) : len;
+ sz = (len<0) ? strlen(buf) : (size_t)len;
if(!(ret = BIO_new(BIO_s_mem())) ) return NULL;
b = (BUF_MEM *)ret->ptr;
b->data = buf;
void *exarg)
{
ASN1_STREAM_ARG *sarg = exarg;
- CMS_ContentInfo *cms;
+ CMS_ContentInfo *cms = NULL;
if (pval)
cms = (CMS_ContentInfo *)*pval;
else
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);
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)
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)
{
/* 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)
{
return NULL;
}
+#endif
int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri,
EVP_PKEY **pk, X509 **recip,
}
}
-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))
{
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))
{
}
-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;
*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;
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;
}
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);
#include <openssl/x509.h>
#include <openssl/asn1.h>
#include <openssl/dh.h>
+#include <openssl/bn.h>
#include "asn1_locl.h"
static void int_dh_free(EVP_PKEY *pkey)
#include <openssl/x509.h>
#include <openssl/rsa.h>
#include <openssl/evp.h>
+#include <openssl/dh.h>
+#include <openssl/bn.h>
#include "evp_locl.h"
/* DH pkey context structure */
#include <openssl/x509.h>
#include <openssl/asn1.h>
#include <openssl/dsa.h>
+#include <openssl/bn.h>
#ifndef OPENSSL_NO_CMS
#include <openssl/cms.h>
#endif
#include <openssl/asn1t.h>
#include <openssl/x509.h>
#include <openssl/evp.h>
+#include <openssl/bn.h>
#include "evp_locl.h"
#include "dsa_locl.h"
#include "cryptlib.h"
#include <openssl/x509.h>
#include <openssl/ec.h>
+#include <openssl/bn.h>
#ifndef OPENSSL_NO_CMS
#include <openssl/cms.h>
#endif
#include "cryptlib.h"
#include <openssl/evp.h>
#include <openssl/ec.h>
+#include <openssl/bn.h>
#ifndef OPENSSL_NO_FP_API
int ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off)
#include "eng_int.h"
#include "asn1_locl.h"
+#include <openssl/evp.h>
/* If this symbol is defined then ENGINE_get_pkey_asn1_meth_engine(), the
* function that is used by EVP to hook in pkey_asn1_meth code and cache
*/
#include "eng_int.h"
+#include <openssl/evp.h>
/* If this symbol is defined then ENGINE_get_pkey_meth_engine(), the function
* that is used by EVP to hook in pkey_meth code and cache defaults (etc), will
return 1;
}
return 0;
-#if PBE_PRF_TEST
+#ifdef PBE_PRF_TEST
case EVP_CTRL_PBE_PRF_NID:
*(int *)ptr = NID_hmacWithMD5;
return 1;
#include "cryptlib.h"
#include <openssl/objects.h>
#include <openssl/evp.h>
+#include <openssl/bn.h>
#include "evp_locl.h"
int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx)
#include <openssl/lhash.h>
#include <openssl/asn1.h>
#include <openssl/objects.h>
+#include <openssl/bn.h>
/* obj_dat.h is generated from objects.h by obj_dat.pl */
#ifndef OPENSSL_NO_OBJECT
#include "cryptlib.h"
#include <openssl/pem.h>
#include <openssl/rand.h>
+#include <openssl/bn.h>
+#include <openssl/dsa.h>
+#include <openssl/rsa.h>
/* Utility function: read a DWORD (4 byte unsigned integer) in little endian
* format
#include <openssl/asn1t.h>
#include <openssl/x509.h>
#include <openssl/rsa.h>
+#include <openssl/bn.h>
#ifndef OPENSSL_NO_CMS
#include <openssl/cms.h>
#endif
#include <openssl/asn1t.h>
#include <openssl/x509.h>
#include <openssl/rsa.h>
+#include <openssl/bn.h>
#include <openssl/evp.h>
#include "evp_locl.h"
#include "rsa_locl.h"
#include <string.h>
+#include <openssl/crypto.h>
+#include "cryptlib.h"
#include <openssl/pem.h>
#include <openssl/engine.h>
#include <openssl/ts.h>
* for OpenSSL *
* Requires OpenSSL 0.9.9 for compilation *
**********************************************************************/
+#include <string.h>
+#include <openssl/crypto.h>
+#include <openssl/err.h>
#include <openssl/engine.h>
#include <openssl/evp.h>
#include <openssl/asn1.h>
-#include <string.h>
#include "gost_params.h"
#include "gost_lcl.h"
#include "e_gost_err.h"
**********************************************************************/
#include <stdlib.h>
#include <string.h>
+#include <openssl/crypto.h>
+#include <openssl/err.h>
#include <openssl/engine.h>
#include <openssl/buffer.h>
#include "gost_lcl.h"
* Requires OpenSSL 0.9.9 for compilation *
**********************************************************************/
#include <string.h>
+#include <openssl/crypto.h>
+#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/engine.h>
#include <openssl/obj_mac.h>
#include <openssl/objects.h>
#include <openssl/evp.h>
#include <openssl/md5.h>
+#include <openssl/bn.h>
#ifndef OPENSSL_NO_DH
#include <openssl/dh.h>
#endif
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/md5.h>
+#include <openssl/bn.h>
#ifndef OPENSSL_NO_DH
#include <openssl/dh.h>
#endif
int tls1_ec_curve_id2nid(int curve_id)
{
/* ECC curves from draft-ietf-tls-ecc-12.txt (Oct. 17, 2005) */
- if ((curve_id < 1) || (curve_id > sizeof(nid_list)/sizeof(nid_list[0]))) return 0;
+ if ((curve_id < 1) || ((unsigned int)curve_id >
+ sizeof(nid_list)/sizeof(nid_list[0])))
+ return 0;
return nid_list[curve_id-1];
}
SSLerr(SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT,ERR_R_MALLOC_FAILURE);
return -1;
}
- for (i = 1, j = s->tlsext_ellipticcurvelist; i <= sizeof(nid_list)/sizeof(nid_list[0]); i++)
+ for (i = 1, j = s->tlsext_ellipticcurvelist; (unsigned int)i <=
+ sizeof(nid_list)/sizeof(nid_list[0]); i++)
s2n(i,j);
}
#endif /* OPENSSL_NO_EC */
static int run_test_vectors(void)
{
- int n;
+ unsigned int n;
int errs = 0;
for(n=0 ; n < sizeof(ige_test_vectors)/sizeof(ige_test_vectors[0]) ; ++n)
unsigned char iv[AES_BLOCK_SIZE*4];
unsigned char saved_iv[AES_BLOCK_SIZE*4];
int err = 0;
- int n;
+ unsigned int n;
unsigned matches;
assert(BIG_TEST_SIZE >= TEST_SIZE);