提交 9b3086fe 编写于 作者: D Dr. Stephen Henson

Fix various stuff: that VC++ 5.0 chokes on:

1. Add *lots* of missing prototypes for static ssl functions.
2. VC++ doesn't understand the 'LL' suffix for 64 bits constants: change bn.org
3. Add a few missing prototypes in pem.org
Fix mk1mf.pl so it outputs a Makefile that doesn't choke Win95.
Fix mkdef.pl so it doesn't truncate longer names.
上级 d433f901
...@@ -169,7 +169,12 @@ extern "C" { ...@@ -169,7 +169,12 @@ extern "C" {
#define BN_BYTES 4 #define BN_BYTES 4
#define BN_BITS2 32 #define BN_BITS2 32
#define BN_BITS4 16 #define BN_BITS4 16
#ifdef WIN32
/* VC++ doesn't like the LL suffix */
#define BN_MASK (0xffffffffffffffffL)
#else
#define BN_MASK (0xffffffffffffffffLL) #define BN_MASK (0xffffffffffffffffLL)
#endif
#define BN_MASK2 (0xffffffffL) #define BN_MASK2 (0xffffffffL)
#define BN_MASK2l (0xffff) #define BN_MASK2l (0xffff)
#define BN_MASK2h1 (0xffff8000L) #define BN_MASK2h1 (0xffff8000L)
......
...@@ -501,6 +501,7 @@ EVP_PKEY *PEM_read_PrivateKey(); ...@@ -501,6 +501,7 @@ EVP_PKEY *PEM_read_PrivateKey();
PKCS7 *PEM_read_PKCS7(); PKCS7 *PEM_read_PKCS7();
DH *PEM_read_DHparams(); DH *PEM_read_DHparams();
DSA *PEM_read_DSAparams(); DSA *PEM_read_DSAparams();
NETSCAPE_CERT_SEQUENCE *PEM_read_NETSCAPE_CERT_SEQUENCE();
int PEM_write_X509(); int PEM_write_X509();
int PEM_write_X509_REQ(); int PEM_write_X509_REQ();
int PEM_write_X509_CRL(); int PEM_write_X509_CRL();
...@@ -511,6 +512,7 @@ int PEM_write_PrivateKey(); ...@@ -511,6 +512,7 @@ int PEM_write_PrivateKey();
int PEM_write_PKCS7(); int PEM_write_PKCS7();
int PEM_write_DHparams(); int PEM_write_DHparams();
int PEM_write_DSAparams(); int PEM_write_DSAparams();
int PEM_write_NETSCAPE_CERT_SEQUENCE();
#endif #endif
X509 *PEM_read_bio_X509(); X509 *PEM_read_bio_X509();
...@@ -523,6 +525,7 @@ EVP_PKEY *PEM_read_bio_PrivateKey(); ...@@ -523,6 +525,7 @@ EVP_PKEY *PEM_read_bio_PrivateKey();
PKCS7 *PEM_read_bio_PKCS7(); PKCS7 *PEM_read_bio_PKCS7();
DH *PEM_read_bio_DHparams(); DH *PEM_read_bio_DHparams();
DSA *PEM_read_bio_DSAparams(); DSA *PEM_read_bio_DSAparams();
NETSCAPE_CERT_SEQUENCE *PEM_read_bio_NETSCAPE_CERT_SEQUENCE();
int PEM_write_bio_X509(); int PEM_write_bio_X509();
int PEM_write_bio_X509_REQ(); int PEM_write_bio_X509_REQ();
int PEM_write_bio_X509_CRL(); int PEM_write_bio_X509_CRL();
...@@ -533,6 +536,7 @@ int PEM_write_bio_PrivateKey(); ...@@ -533,6 +536,7 @@ int PEM_write_bio_PrivateKey();
int PEM_write_bio_PKCS7(); int PEM_write_bio_PKCS7();
int PEM_write_bio_DHparams(); int PEM_write_bio_DHparams();
int PEM_write_bio_DSAparams(); int PEM_write_bio_DSAparams();
int PEM_write_bio_NETSCAPE_CERT_SEQUENCE();
#endif /* SSLEAY_MACROS */ #endif /* SSLEAY_MACROS */
......
...@@ -66,9 +66,11 @@ ...@@ -66,9 +66,11 @@
#define BREAK break #define BREAK break
#ifndef NOPROTO #ifndef NOPROTO
static SSL_METHOD *ssl23_get_client_method(int ver);
static int ssl23_client_hello(SSL *s); static int ssl23_client_hello(SSL *s);
static int ssl23_get_server_hello(SSL *s); static int ssl23_get_server_hello(SSL *s);
#else #else
static SSL_METHOD *ssl23_get_client_method();
static int ssl23_client_hello(); static int ssl23_client_hello();
static int ssl23_get_server_hello(); static int ssl23_get_server_hello();
#endif #endif
......
...@@ -88,7 +88,7 @@ static SSL_METHOD SSLv23_data= { ...@@ -88,7 +88,7 @@ static SSL_METHOD SSLv23_data= {
ssl_undefined_function, ssl_undefined_function,
ssl_undefined_function, ssl_undefined_function,
ssl23_read, ssl23_read,
(int (*)())ssl_undefined_function, (int (*)(struct ssl_st *, char *, int))ssl_undefined_function,
ssl23_write, ssl23_write,
ssl_undefined_function, ssl_undefined_function,
ssl_undefined_function, ssl_undefined_function,
......
...@@ -60,6 +60,12 @@ ...@@ -60,6 +60,12 @@
#include "objects.h" #include "objects.h"
#include "ssl_locl.h" #include "ssl_locl.h"
#ifndef NOPROTO
static SSL_METHOD *ssl23_get_method(int ver);
#else
static SSL_METHOD *ssl23_get_method();
#endif
static SSL_METHOD *ssl23_get_method(ver) static SSL_METHOD *ssl23_get_method(ver)
int ver; int ver;
{ {
......
...@@ -66,8 +66,10 @@ ...@@ -66,8 +66,10 @@
#define BREAK break #define BREAK break
#ifndef NOPROTO #ifndef NOPROTO
static SSL_METHOD *ssl23_get_server_method(int ver);
int ssl23_get_client_hello(SSL *s); int ssl23_get_client_hello(SSL *s);
#else #else
static SSL_METHOD *ssl23_get_server_method();
int ssl23_get_client_hello(); int ssl23_get_client_hello();
#endif #endif
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#include "evp.h" #include "evp.h"
#ifndef NOPROTO #ifndef NOPROTO
static SSL_METHOD *ssl2_get_client_method(int ver);
static int get_server_finished(SSL *s); static int get_server_finished(SSL *s);
static int get_server_verify(SSL *s); static int get_server_verify(SSL *s);
static int get_server_hello(SSL *s); static int get_server_hello(SSL *s);
...@@ -74,6 +75,7 @@ static int client_certificate(SSL *s); ...@@ -74,6 +75,7 @@ static int client_certificate(SSL *s);
static int ssl_rsa_public_encrypt(CERT *c, int len, unsigned char *from, static int ssl_rsa_public_encrypt(CERT *c, int len, unsigned char *from,
unsigned char *to,int padding); unsigned char *to,int padding);
#else #else
static SSL_METHOD *ssl2_get_client_method();
static int get_server_finished(); static int get_server_finished();
static int get_server_verify(); static int get_server_verify();
static int get_server_hello(); static int get_server_hello();
......
...@@ -60,6 +60,12 @@ ...@@ -60,6 +60,12 @@
#include "objects.h" #include "objects.h"
#include "ssl_locl.h" #include "ssl_locl.h"
#ifndef NOPROTO
static SSL_METHOD *ssl2_get_method(int ver);
#else
static SSL_METHOD *ssl2_get_method();
#endif
static SSL_METHOD *ssl2_get_method(ver) static SSL_METHOD *ssl2_get_method(ver)
int ver; int ver;
{ {
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#include "evp.h" #include "evp.h"
#ifndef NOPROTO #ifndef NOPROTO
static SSL_METHOD *ssl2_get_server_method(int ver);
static int get_client_master_key(SSL *s); static int get_client_master_key(SSL *s);
static int get_client_hello(SSL *s); static int get_client_hello(SSL *s);
static int server_hello(SSL *s); static int server_hello(SSL *s);
...@@ -74,6 +75,7 @@ static int request_certificate(SSL *s); ...@@ -74,6 +75,7 @@ static int request_certificate(SSL *s);
static int ssl_rsa_private_decrypt(CERT *c, int len, unsigned char *from, static int ssl_rsa_private_decrypt(CERT *c, int len, unsigned char *from,
unsigned char *to,int padding); unsigned char *to,int padding);
#else #else
static SSL_METHOD *ssl2_get_server_method();
static int get_client_master_key(); static int get_client_master_key();
static int get_client_hello(); static int get_client_hello();
static int server_hello(); static int server_hello();
......
...@@ -74,6 +74,7 @@ SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_SSL3_SESSION_ID_TOO_SHORT); ...@@ -74,6 +74,7 @@ SSLerr(SSL_F_SSL3_GET_SERVER_HELLO,SSL_R_SSL3_SESSION_ID_TOO_SHORT);
*/ */
#ifndef NOPROTO #ifndef NOPROTO
static SSL_METHOD *ssl3_get_client_method(int ver);
static int ssl3_client_hello(SSL *s); static int ssl3_client_hello(SSL *s);
static int ssl3_get_server_hello(SSL *s); static int ssl3_get_server_hello(SSL *s);
static int ssl3_get_certificate_request(SSL *s); static int ssl3_get_certificate_request(SSL *s);
...@@ -86,6 +87,7 @@ static int ssl3_get_key_exchange(SSL *s); ...@@ -86,6 +87,7 @@ static int ssl3_get_key_exchange(SSL *s);
static int ssl3_get_server_certificate(SSL *s); static int ssl3_get_server_certificate(SSL *s);
static int ssl3_check_cert_and_algorithm(SSL *s); static int ssl3_check_cert_and_algorithm(SSL *s);
#else #else
static SSL_METHOD *ssl3_get_client_method();
static int ssl3_client_hello(); static int ssl3_client_hello();
static int ssl3_get_server_hello(); static int ssl3_get_server_hello();
static int ssl3_get_certificate_request(); static int ssl3_get_certificate_request();
......
...@@ -60,6 +60,12 @@ ...@@ -60,6 +60,12 @@
#include "objects.h" #include "objects.h"
#include "ssl_locl.h" #include "ssl_locl.h"
#ifndef NOPROTO
static SSL_METHOD *ssl3_get_method(int ver);
#else
static SSL_METHOD *ssl3_get_method();
#endif
static SSL_METHOD *ssl3_get_method(ver) static SSL_METHOD *ssl3_get_method(ver)
int ver; int ver;
{ {
......
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
*/ */
#ifndef NOPROTO #ifndef NOPROTO
static SSL_METHOD *ssl3_get_server_method(int ver);
static int ssl3_get_client_hello(SSL *s); static int ssl3_get_client_hello(SSL *s);
static int ssl3_send_server_hello(SSL *s); static int ssl3_send_server_hello(SSL *s);
static int ssl3_send_server_key_exchange(SSL *s); static int ssl3_send_server_key_exchange(SSL *s);
...@@ -87,6 +88,7 @@ static int ssl3_send_hello_request(SSL *s); ...@@ -87,6 +88,7 @@ static int ssl3_send_hello_request(SSL *s);
#else #else
static SSL_METHOD *ssl3_get_server_method();
static int ssl3_get_client_hello(); static int ssl3_get_client_hello();
static int ssl3_send_server_hello(); static int ssl3_send_server_hello();
static int ssl3_send_server_key_exchange(); static int ssl3_send_server_key_exchange();
......
...@@ -844,7 +844,7 @@ STACK * SSL_get_peer_cert_chain(SSL *s); ...@@ -844,7 +844,7 @@ STACK * SSL_get_peer_cert_chain(SSL *s);
int SSL_CTX_get_verify_mode(SSL_CTX *ctx); int SSL_CTX_get_verify_mode(SSL_CTX *ctx);
int (*SSL_CTX_get_verify_callback(SSL_CTX *ctx))(); int (*SSL_CTX_get_verify_callback(SSL_CTX *ctx))();
void SSL_CTX_set_verify(SSL_CTX *ctx,int mode,int (*callback)()); void SSL_CTX_set_verify(SSL_CTX *ctx,int mode,int (*callback)(int, X509_STORE_CTX *));
void SSL_CTX_set_cert_verify_cb(SSL_CTX *ctx, int (*cb)(),char *arg); void SSL_CTX_set_cert_verify_cb(SSL_CTX *ctx, int (*cb)(),char *arg);
int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa); int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa);
int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, unsigned char *d, long len); int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, unsigned char *d, long len);
......
...@@ -1043,7 +1043,11 @@ char *arg; ...@@ -1043,7 +1043,11 @@ char *arg;
void SSL_CTX_set_verify(ctx,mode,cb) void SSL_CTX_set_verify(ctx,mode,cb)
SSL_CTX *ctx; SSL_CTX *ctx;
int mode; int mode;
#ifndef NOPROTO
int (*cb)(int, X509_STORE_CTX *);
#else
int (*cb)(); int (*cb)();
#endif
{ {
ctx->default_verify_mode=mode; ctx->default_verify_mode=mode;
ctx->default_verify_callback=cb; ctx->default_verify_callback=cb;
......
...@@ -63,6 +63,12 @@ ...@@ -63,6 +63,12 @@
#include "evp.h" #include "evp.h"
#include "ssl_locl.h" #include "ssl_locl.h"
#ifndef NOPROTO
static SSL_METHOD *tls1_get_client_method(int ver);
#else
static SSL_METHOD *tls1_get_client_method();
#endif
static SSL_METHOD *tls1_get_client_method(ver) static SSL_METHOD *tls1_get_client_method(ver)
int ver; int ver;
{ {
......
...@@ -60,6 +60,12 @@ ...@@ -60,6 +60,12 @@
#include "objects.h" #include "objects.h"
#include "ssl_locl.h" #include "ssl_locl.h"
#ifndef NOPROTO
static SSL_METHOD *tls1_get_method(int ver);
#else
static SSL_METHOD *tls1_get_method();
#endif
static SSL_METHOD *tls1_get_method(ver) static SSL_METHOD *tls1_get_method(ver)
int ver; int ver;
{ {
......
...@@ -64,6 +64,12 @@ ...@@ -64,6 +64,12 @@
#include "x509.h" #include "x509.h"
#include "ssl_locl.h" #include "ssl_locl.h"
#ifndef NOPROTO
static SSL_METHOD *tls1_get_server_method(int ver);
#else
static SSL_METHOD *tls1_get_server_method();
#endif
static SSL_METHOD *tls1_get_server_method(ver) static SSL_METHOD *tls1_get_server_method(ver)
int ver; int ver;
{ {
......
...@@ -231,12 +231,12 @@ sub print_def_file ...@@ -231,12 +231,12 @@ sub print_def_file
print OUT <<"EOF"; print OUT <<"EOF";
; ;
; Definition file for the DDL version of the $name library from SSLeay ; Definition file for the DLL version of the $name library from OpenSSL
; ;
LIBRARY $name LIBRARY $name
DESCRIPTION 'SSLeay $name - eay\@cryptsoft.com' DESCRIPTION 'OpenSSL $name - http://www.openssl.org/'
EOF EOF
...@@ -270,7 +270,7 @@ EOF ...@@ -270,7 +270,7 @@ EOF
else else
{ {
$n=$nums{$func}; $n=$nums{$func};
printf OUT " %s%-35s@%d\n",($NT)?"":"_",$func,$n; printf OUT " %s%-40s@%d\n",($NT)?"":"_",$func,$n;
} }
} }
printf OUT "\n"; printf OUT "\n";
......
...@@ -7,7 +7,7 @@ $crypto="libeay32"; ...@@ -7,7 +7,7 @@ $crypto="libeay32";
$RSAref="RSAref32"; $RSAref="RSAref32";
$o='\\'; $o='\\';
$cp='"copy /b nul+ "'; # Timestamps get stuffed otherwise $cp='copy nul+'; # Timestamps get stuffed otherwise
$rm='del'; $rm='del';
# C compiler stuff # C compiler stuff
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册