ssl_lib.c (76866) | ssl_lib.c (89837) |
---|---|
1/*! \file ssl/ssl_lib.c 2 * \brief Version independent SSL functions. 3 */ 4/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 5 * All rights reserved. 6 * 7 * This package is an SSL implementation written 8 * by Eric Young (eay@cryptsoft.com). --- 128 unchanged lines hidden (view full) --- 137 s->session=NULL; 138 } 139 140 s->first_packet=0; 141 142#if 1 143 /* Check to see if we were changed into a different method, if 144 * so, revert back if we are not doing session-id reuse. */ | 1/*! \file ssl/ssl_lib.c 2 * \brief Version independent SSL functions. 3 */ 4/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 5 * All rights reserved. 6 * 7 * This package is an SSL implementation written 8 * by Eric Young (eay@cryptsoft.com). --- 128 unchanged lines hidden (view full) --- 137 s->session=NULL; 138 } 139 140 s->first_packet=0; 141 142#if 1 143 /* Check to see if we were changed into a different method, if 144 * so, revert back if we are not doing session-id reuse. */ |
145 if ((s->session == NULL) && (s->method != s->ctx->method)) | 145 if (!s->in_handshake && (s->session == NULL) && (s->method != s->ctx->method)) |
146 { 147 s->method->ssl_free(s); 148 s->method=s->ctx->method; 149 if (!s->method->ssl_new(s)) 150 return(0); 151 } 152 else 153#endif --- 252 unchanged lines hidden (view full) --- 406BIO *SSL_get_rbio(SSL *s) 407 { return(s->rbio); } 408 409BIO *SSL_get_wbio(SSL *s) 410 { return(s->wbio); } 411 412int SSL_get_fd(SSL *s) 413 { | 146 { 147 s->method->ssl_free(s); 148 s->method=s->ctx->method; 149 if (!s->method->ssl_new(s)) 150 return(0); 151 } 152 else 153#endif --- 252 unchanged lines hidden (view full) --- 406BIO *SSL_get_rbio(SSL *s) 407 { return(s->rbio); } 408 409BIO *SSL_get_wbio(SSL *s) 410 { return(s->wbio); } 411 412int SSL_get_fd(SSL *s) 413 { |
414 return(SSL_get_rfd(s)); 415 } 416 417int SSL_get_rfd(SSL *s) 418 { |
|
414 int ret= -1; 415 BIO *b,*r; 416 417 b=SSL_get_rbio(s); 418 r=BIO_find_type(b,BIO_TYPE_DESCRIPTOR); 419 if (r != NULL) 420 BIO_get_fd(r,&ret); 421 return(ret); 422 } 423 | 419 int ret= -1; 420 BIO *b,*r; 421 422 b=SSL_get_rbio(s); 423 r=BIO_find_type(b,BIO_TYPE_DESCRIPTOR); 424 if (r != NULL) 425 BIO_get_fd(r,&ret); 426 return(ret); 427 } 428 |
429int SSL_get_wfd(SSL *s) 430 { 431 int ret= -1; 432 BIO *b,*r; 433 434 b=SSL_get_wbio(s); 435 r=BIO_find_type(b,BIO_TYPE_DESCRIPTOR); 436 if (r != NULL) 437 BIO_get_fd(r,&ret); 438 return(ret); 439 } 440 |
|
424#ifndef NO_SOCK 425int SSL_set_fd(SSL *s,int fd) 426 { 427 int ret=0; 428 BIO *bio=NULL; 429 430 bio=BIO_new(BIO_s_socket()); 431 --- 839 unchanged lines hidden (view full) --- 1271 ctx->app_verify_callback=cb; 1272 ctx->app_verify_arg=arg; /* never used */ 1273 } 1274 1275void SSL_CTX_set_verify(SSL_CTX *ctx,int mode,int (*cb)(int, X509_STORE_CTX *)) 1276 { 1277 ctx->verify_mode=mode; 1278 ctx->default_verify_callback=cb; | 441#ifndef NO_SOCK 442int SSL_set_fd(SSL *s,int fd) 443 { 444 int ret=0; 445 BIO *bio=NULL; 446 447 bio=BIO_new(BIO_s_socket()); 448 --- 839 unchanged lines hidden (view full) --- 1288 ctx->app_verify_callback=cb; 1289 ctx->app_verify_arg=arg; /* never used */ 1290 } 1291 1292void SSL_CTX_set_verify(SSL_CTX *ctx,int mode,int (*cb)(int, X509_STORE_CTX *)) 1293 { 1294 ctx->verify_mode=mode; 1295 ctx->default_verify_callback=cb; |
1279 /* This needs cleaning up EAY EAY EAY */ 1280 X509_STORE_set_verify_cb_func(ctx->cert_store,cb); | |
1281 } 1282 1283void SSL_CTX_set_verify_depth(SSL_CTX *ctx,int depth) 1284 { 1285 ctx->verify_depth=depth; 1286 } 1287 1288void ssl_set_cert_masks(CERT *c, SSL_CIPHER *cipher) --- 786 unchanged lines hidden --- | 1296 } 1297 1298void SSL_CTX_set_verify_depth(SSL_CTX *ctx,int depth) 1299 { 1300 ctx->verify_depth=depth; 1301 } 1302 1303void ssl_set_cert_masks(CERT *c, SSL_CIPHER *cipher) --- 786 unchanged lines hidden --- |