From c20276e4aef1e716980589c43cf9276abc7ff2b7 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Mon, 17 Apr 2006 12:08:22 +0000 Subject: [PATCH] Fix (most) WIN32 warnings and errors. --- crypto/asn1/Makefile | 2 +- crypto/asn1/ameth_lib.c | 2 +- crypto/dh/dh_ameth.c | 2 +- crypto/dsa/dsa_ameth.c | 2 +- crypto/evp/Makefile | 2 +- crypto/evp/pmeth_fn.c | 2 +- crypto/evp/pmeth_gn.c | 2 +- crypto/evp/pmeth_lib.c | 2 +- crypto/rsa/rsa_ameth.c | 2 +- ssl/s3_lib.c | 3 +- util/libeay.num | 72 +++++++++++++++++++++++++++++++++++++++++ util/mkdef.pl | 6 ++++ util/ssleay.num | 10 +++--- 13 files changed, 95 insertions(+), 14 deletions(-) diff --git a/crypto/asn1/Makefile b/crypto/asn1/Makefile index 1240d86754..faaf95b0a9 100644 --- a/crypto/asn1/Makefile +++ b/crypto/asn1/Makefile @@ -47,7 +47,7 @@ LIBOBJ= a_object.o a_bitstr.o a_utctm.o a_gentm.o a_time.o a_int.o a_octet.o \ SRC= $(LIBSRC) EXHEADER= asn1.h asn1_mac.h asn1t.h -HEADER= $(EXHEADER) +HEADER= $(EXHEADER) asn1_locl.h ALL= $(GENERAL) $(SRC) $(HEADER) diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c index 4dd0dfa62b..17b3c68fc7 100644 --- a/crypto/asn1/ameth_lib.c +++ b/crypto/asn1/ameth_lib.c @@ -167,7 +167,7 @@ const EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(const char *str, int len) ameth = EVP_PKEY_asn1_get0(i); if (ameth->pkey_flags & ASN1_PKEY_ALIAS) continue; - if ((strlen(ameth->pem_str) == len) && + if (((int)strlen(ameth->pem_str) == len) && !strncasecmp(ameth->pem_str, str, len)) return ameth; } diff --git a/crypto/dh/dh_ameth.c b/crypto/dh/dh_ameth.c index 7a83768e2c..2f2589bc25 100644 --- a/crypto/dh/dh_ameth.c +++ b/crypto/dh/dh_ameth.c @@ -287,7 +287,7 @@ err: static void update_buflen(const BIGNUM *b, size_t *pbuflen) { - int i; + size_t i; if (!b) return; if (*pbuflen < (i = (size_t)BN_num_bytes(b))) diff --git a/crypto/dsa/dsa_ameth.c b/crypto/dsa/dsa_ameth.c index 56d2099ba4..eafdc2e5d4 100644 --- a/crypto/dsa/dsa_ameth.c +++ b/crypto/dsa/dsa_ameth.c @@ -400,7 +400,7 @@ static void int_dsa_free(EVP_PKEY *pkey) static void update_buflen(const BIGNUM *b, size_t *pbuflen) { - int i; + size_t i; if (!b) return; if (*pbuflen < (i = (size_t)BN_num_bytes(b))) diff --git a/crypto/evp/Makefile b/crypto/evp/Makefile index 71fbc0c47c..5f589f27a9 100644 --- a/crypto/evp/Makefile +++ b/crypto/evp/Makefile @@ -45,7 +45,7 @@ LIBOBJ= encode.o digest.o evp_enc.o evp_key.o evp_acnf.o \ SRC= $(LIBSRC) EXHEADER= evp.h -HEADER= $(EXHEADER) +HEADER= evp_locl.h $(EXHEADER) ALL= $(GENERAL) $(SRC) $(HEADER) diff --git a/crypto/evp/pmeth_fn.c b/crypto/evp/pmeth_fn.c index 0b97fb5cc7..dbd639bef2 100644 --- a/crypto/evp/pmeth_fn.c +++ b/crypto/evp/pmeth_fn.c @@ -58,8 +58,8 @@ #include #include -#include #include "cryptlib.h" +#include #include #include "evp_locl.h" diff --git a/crypto/evp/pmeth_gn.c b/crypto/evp/pmeth_gn.c index 4972d5e96d..da7d800f53 100644 --- a/crypto/evp/pmeth_gn.c +++ b/crypto/evp/pmeth_gn.c @@ -58,8 +58,8 @@ #include #include -#include #include "cryptlib.h" +#include #include #include "evp_locl.h" diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c index d68972c7c4..80a130fbbf 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -58,8 +58,8 @@ #include #include -#include #include "cryptlib.h" +#include #include #include "asn1_locl.h" #include "evp_locl.h" diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c index a4658c262a..4acc11db33 100644 --- a/crypto/rsa/rsa_ameth.c +++ b/crypto/rsa/rsa_ameth.c @@ -169,7 +169,7 @@ static void int_rsa_free(EVP_PKEY *pkey) static void update_buflen(const BIGNUM *b, size_t *pbuflen) { - int i; + size_t i; if (!b) return; if (*pbuflen < (i = (size_t)BN_num_bytes(b))) diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 94bdb63cdb..c59fb556d9 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -2043,7 +2043,8 @@ SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, { SSL_CIPHER *c,*ret=NULL; STACK_OF(SSL_CIPHER) *prio, *allow; - int i,j,ok; + int i,ok; + unsigned int j; #ifndef OPENSSL_NO_TLSEXT #ifndef OPENSSL_NO_EC int ec_ok, ec_nid; diff --git a/util/libeay.num b/util/libeay.num index cce50b8895..1ba21f7d09 100755 --- a/util/libeay.num +++ b/util/libeay.num @@ -3611,3 +3611,75 @@ TS_TST_INFO_get_ext 4006 EXIST::FUNCTION: TS_TST_INFO_get_ext_by_critical 4007 EXIST::FUNCTION: TS_REQ_get_ext_by_OBJ 4008 EXIST::FUNCTION: TS_CONF_set_signer_cert 4009 EXIST::FUNCTION: +EVP_PKEY_print_public 4010 EXIST::FUNCTION: +EVP_PKEY_CTX_new 4011 EXIST::FUNCTION: +EVP_PKEY_asn1_find 4012 EXIST::FUNCTION: +DSO_METHOD_beos 4013 EXIST::FUNCTION: +EVP_PKEY_sign_init 4014 EXIST::FUNCTION: +EVP_PKEY_asn1_add0 4015 EXIST::FUNCTION: +EVP_PKEY_meth_set_decrypt 4016 EXIST::FUNCTION: +EVP_PKEY_CTX_get_keygen_info 4017 EXIST::FUNCTION: +EVP_PKEY_keygen 4018 EXIST::FUNCTION: +EVP_PKEY_asn1_new 4019 EXIST::FUNCTION: +EVP_PKEY_encrypt_old 4020 EXIST::FUNCTION: +EVP_PKEY_encrypt_init 4021 EXIST::FUNCTION: +EVP_PKEY_asn1_set_public 4022 EXIST::FUNCTION: +EVP_PKEY_asn1_set_free 4023 EXIST::FUNCTION: +EVP_PKEY_verify_recover_init 4024 EXIST::FUNCTION: +EVP_PKEY_CTX_set_data 4025 EXIST::FUNCTION: +EVP_PKEY_keygen_init 4026 EXIST::FUNCTION: +EVP_PKEY_CTX_ctrl_str 4027 EXIST::FUNCTION: +BN_asc2bn 4028 EXIST::FUNCTION: +X509_ALGOR_get0 4029 EXIST::FUNCTION: +EVP_PKEY_print_params 4030 EXIST::FUNCTION: +X509_PUBKEY_set0_param 4031 EXIST::FUNCTION: +X509_ALGOR_set0 4032 EXIST::FUNCTION: +EVP_PKEY_CTX_get_data 4033 EXIST::FUNCTION: +EVP_PKEY_derive_init 4034 EXIST::FUNCTION: +EVP_PKEY_asn1_add_alias 4035 EXIST::FUNCTION: +EVP_PKEY_CTX_ctrl 4036 EXIST::FUNCTION: +EVP_PKEY_meth_set_ctrl 4037 EXIST::FUNCTION: +EVP_PKEY_meth_set_sign 4038 EXIST::FUNCTION: +EVP_PKEY_decrypt_init 4039 EXIST::FUNCTION: +EVP_PKEY_print_private 4040 EXIST::FUNCTION: +PKCS8_pkey_get0 4041 EXIST::FUNCTION: +EVP_PKEY_asn1_get0 4042 EXIST::FUNCTION: +EVP_PKEY_paramgen_init 4043 EXIST::FUNCTION: +EVP_PKEY_sign 4044 EXIST::FUNCTION: +EVP_PKEY_meth_set_init 4045 EXIST::FUNCTION: +EVP_PKEY_meth_set_verify_recover 4046 EXIST::FUNCTION: +EVP_PKEY_CTX_set_cb 4047 EXIST::FUNCTION: +EVP_PKEY_meth_set_derive 4048 EXIST::FUNCTION: +BUF_reverse 4049 EXIST::FUNCTION: +ASN1_bn_print 4050 EXIST::FUNCTION:BIO +EVP_PKEY_asn1_get_count 4051 EXIST::FUNCTION: +PKCS8_pkey_set0 4052 EXIST::FUNCTION: +EVP_PKEY_asn1_set_private 4053 EXIST::FUNCTION: +EVP_PKEY_meth_set_verify 4054 EXIST::FUNCTION: +EVP_PKEY_asn1_get0_info 4055 EXIST::FUNCTION: +EVP_PKEY_CTX_set_app_data 4056 EXIST::FUNCTION: +EVP_PKEY_meth_set_verifyctx 4057 EXIST::FUNCTION: +EVP_PKEY_CTX_get_app_data 4058 EXIST::FUNCTION: +X509_PUBKEY_get0_param 4059 EXIST::FUNCTION: +EVP_PKEY_asn1_set_param 4060 EXIST::FUNCTION: +EVP_PKEY_meth_set_encrypt 4061 EXIST::FUNCTION: +EVP_PKEY_verify 4062 EXIST::FUNCTION: +EVP_PKEY_decrypt_old 4063 EXIST::FUNCTION: +EVP_PKEY_asn1_find_str 4064 EXIST::FUNCTION: +EVP_PKEY_derive 4065 EXIST::FUNCTION: +PEM_write_bio_Parameters 4066 EXIST::FUNCTION: +EVP_PKEY_meth_set_signctx 4067 EXIST::FUNCTION: +EVP_PKEY_CTX_free 4068 EXIST::FUNCTION: +EVP_PKEY_get0 4069 EXIST::FUNCTION: +EVP_PKEY_meth_find 4070 EXIST::FUNCTION: +EVP_PKEY_verify_init 4071 EXIST::FUNCTION: +EVP_PKEY_derive_set_peer 4072 EXIST::FUNCTION: +PEM_read_bio_Parameters 4073 EXIST::FUNCTION: +EVP_PKEY_meth_set_cleanup 4074 EXIST::FUNCTION: +EVP_PKEY_asn1_free 4075 EXIST::FUNCTION: +EVP_PKEY_meth_set_keygen 4076 EXIST::FUNCTION: +EVP_PKEY_paramgen 4077 EXIST::FUNCTION: +EVP_PKEY_meth_set_paramgen 4078 EXIST::FUNCTION: +EVP_PKEY_verify_recover 4079 EXIST::FUNCTION: +EVP_PKEY_asn1_set_ctrl 4080 EXIST::FUNCTION: +EVP_PKEY_CTX_new_id 4081 EXIST::FUNCTION: diff --git a/util/mkdef.pl b/util/mkdef.pl index e3cb0169bf..1e337ce86e 100755 --- a/util/mkdef.pl +++ b/util/mkdef.pl @@ -95,6 +95,8 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", "FP_API", "STDIO", "SOCK", "KRB5", "DGRAM", # Engines "STATIC_ENGINE", "ENGINE", "HW", "GMP", + # TLS + "TLSEXT", "PSK", # Deprecated functions "DEPRECATED" ); @@ -114,6 +116,7 @@ my $no_md2; my $no_md4; my $no_md5; my $no_sha; my $no_ripemd; my $no_mdc2; my $no_rsa; my $no_dsa; my $no_dh; my $no_hmac=0; my $no_aes; my $no_krb5; my $no_ec; my $no_ecdsa; my $no_ecdh; my $no_engine; my $no_hw; my $no_fp_api; my $no_static_engine=1; my $no_gmp; my $no_deprecated; +my $no_psk; my $no_tlsext; foreach (@ARGV, split(/ /, $options)) @@ -225,6 +228,7 @@ $max_crypto = $max_num; my $ssl="ssl/ssl.h"; $ssl.=" ssl/kssl.h"; +$ssl.=" ssl/tls1.h"; my $crypto ="crypto/crypto.h"; $crypto.=" crypto/o_dir.h"; @@ -1107,6 +1111,8 @@ sub is_valid if ($keyword eq "FP_API" && $no_fp_api) { return 0; } if ($keyword eq "STATIC_ENGINE" && $no_static_engine) { return 0; } if ($keyword eq "GMP" && $no_gmp) { return 0; } + if ($keyword eq "TLSEXT" && $no_tlsext) { return 0; } + if ($keyword eq "PSK" && $no_psk) { return 0; } if ($keyword eq "DEPRECATED" && $no_deprecated) { return 0; } # Nothing recognise as true diff --git a/util/ssleay.num b/util/ssleay.num index 0b75f7f0f9..62df6e6a49 100755 --- a/util/ssleay.num +++ b/util/ssleay.num @@ -227,7 +227,9 @@ SSL_COMP_get_compression_methods 276 EXIST:!VMS:FUNCTION:COMP SSL_COMP_get_compress_methods 276 EXIST:VMS:FUNCTION:COMP SSL_SESSION_get_id 277 EXIST::FUNCTION: SSL_set_SSL_CTX 278 EXIST::FUNCTION: -SSL_CTX_use_psk_identity_hint 279 EXIST::FUNCTION: -SSL_get_psk_identity_hint 280 EXIST::FUNCTION: -SSL_get_psk_identity 281 EXIST::FUNCTION: -SSL_use_psk_identity_hint 282 EXIST::FUNCTION: +SSL_CTX_use_psk_identity_hint 279 EXIST::FUNCTION:PSK +SSL_get_psk_identity_hint 280 EXIST::FUNCTION:PSK +SSL_get_psk_identity 281 EXIST::FUNCTION:PSK +SSL_use_psk_identity_hint 282 EXIST::FUNCTION:PSK +SSL_get_servername 283 EXIST::FUNCTION:TLSEXT +SSL_get_servername_type 284 EXIST::FUNCTION:TLSEXT -- GitLab