155 #ifndef OPENSSL_NO_TLSEXT
156 #ifndef OPENSSL_NO_EC
157 #include "../crypto/ec/ec_lcl.h"
161 #ifndef OPENSSL_NO_DH
167 #define SSL3_NUM_CIPHERS (sizeof(ssl3_ciphers)/sizeof(SSL_CIPHER))
270 #ifndef OPENSSL_NO_IDEA
614 SSL3_TXT_FZA_DMS_NULL_SHA,
615 SSL3_CK_FZA_DMS_NULL_SHA,
630 SSL3_TXT_FZA_DMS_FZA_SHA,
631 SSL3_CK_FZA_DMS_FZA_SHA,
646 SSL3_TXT_FZA_DMS_RC4_SHA,
647 SSL3_CK_FZA_DMS_RC4_SHA,
660 #ifndef OPENSSL_NO_KRB5
1171 #ifndef OPENSSL_NO_CAMELLIA
1271 #if TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES
1505 "GOST94-GOST89-GOST89",
1519 "GOST2001-GOST89-GOST89",
1533 "GOST94-NULL-GOST94",
1547 "GOST2001-NULL-GOST94",
1560 #ifndef OPENSSL_NO_CAMELLIA
1659 #ifndef OPENSSL_NO_PSK
1725 #ifndef OPENSSL_NO_SEED
2020 #ifndef OPENSSL_NO_ECDH
2422 #ifndef OPENSSL_NO_SRP
2567 #ifndef OPENSSL_NO_ECDH
2832 #ifdef TEMP_GOST_TLS
2878 "GOST-GOST89STREAM",
2907 (int (*)(
SSL *,
unsigned char *, size_t,
const char *,
2908 size_t,
const unsigned char *, size_t,
2945 memset(s3,0,
sizeof *s3);
2951 #ifndef OPENSSL_NO_SRP
2965 #ifdef TLSEXT_TYPE_opaque_prf_input
2979 #ifndef OPENSSL_NO_DH
2983 #ifndef OPENSSL_NO_ECDH
2988 if (s->
s3->
tmp.ca_names != NULL)
2994 #ifndef OPENSSL_NO_SRP
3004 unsigned char *rp,*wp;
3008 #ifdef TLSEXT_TYPE_opaque_prf_input
3018 if (s->
s3->
tmp.ca_names != NULL)
3026 #ifndef OPENSSL_NO_DH
3033 #ifndef OPENSSL_NO_ECDH
3053 memset(s->
s3,0,
sizeof *s->
s3);
3069 #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG)
3079 #ifndef OPENSSL_NO_SRP
3090 #if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_RSA)
3092 #ifndef OPENSSL_NO_RSA
3096 #ifndef OPENSSL_NO_DSA
3130 #ifndef OPENSSL_NO_RSA
3163 #ifndef OPENSSL_NO_DH
3166 DH *dh = (
DH *)parg;
3199 #ifndef OPENSSL_NO_ECDH
3237 #ifndef OPENSSL_NO_TLSEXT
3270 #ifdef TLSEXT_TYPE_opaque_prf_input
3280 if ((
size_t)larg == 0)
3315 s->tlsext_ocsp_ids = parg;
3331 #ifndef OPENSSL_NO_HEARTBEATS
3363 #if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_RSA)
3365 #ifndef OPENSSL_NO_RSA
3368 #ifndef OPENSSL_NO_DSA
3383 #ifndef OPENSSL_NO_RSA
3390 #ifndef OPENSSL_NO_DH
3397 #ifndef OPENSSL_NO_ECDH
3404 #ifndef OPENSSL_NO_TLSEXT
3407 unsigned char *, int,
void *))
fp;
3424 #ifndef OPENSSL_NO_RSA
3426 if ( (cert->
rsa_tmp == NULL) &&
3469 #ifndef OPENSSL_NO_DH
3489 if (cert->
dh_tmp != NULL)
3502 #ifndef OPENSSL_NO_ECDH
3543 #ifndef OPENSSL_NO_TLSEXT
3550 unsigned char *keys = parg;
3573 #ifdef TLSEXT_TYPE_opaque_prf_input
3584 #ifndef OPENSSL_NO_SRP
3592 if (strlen((
const char *)parg) > 255 || strlen((
const char *)parg) < 1)
3620 if (ctx->extra_certs == NULL)
3633 if (ctx->extra_certs)
3636 ctx->extra_certs = NULL;
3654 #ifndef OPENSSL_NO_RSA
3661 #ifndef OPENSSL_NO_DH
3668 #ifndef OPENSSL_NO_ECDH
3675 #ifndef OPENSSL_NO_TLSEXT
3680 #ifdef TLSEXT_TYPE_opaque_prf_input
3697 #ifndef OPENSSL_NO_SRP
3726 id=0x03000000L|((
unsigned long)p[0]<<8L)|(
unsigned long)p[1];
3729 #ifdef DEBUG_PRINT_UNKNOWN_CIPHERSUITES
3730 if (cp == NULL) fprintf(stderr,
"Unknown cipher ID %x\n", (p[0] << 8) | p[1]);
3732 if (cp == NULL || cp->
valid == 0)
3745 if ((l & 0xff000000) != 0x03000000)
return(0);
3746 p[0]=((
unsigned char)(l>> 8L))&0xFF;
3747 p[1]=((
unsigned char)(l ))&0xFF;
3758 #if !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_EC)
3761 unsigned char ec_search1 = 0, ec_search2 = 0;
3764 unsigned long alg_k,alg_a,mask_k,mask_a,emask_k,emask_a;
3784 printf(
"%p:%s\n",(
void *)c,c->
name);
3790 printf(
"%p:%s\n",(
void *)c,c->
name);
3819 #ifndef OPENSSL_NO_SRP
3831 #ifndef OPENSSL_NO_KRB5
3838 #ifndef OPENSSL_NO_PSK
3846 ok = (alg_k & emask_k) && (alg_a & emask_a);
3848 printf(
"%d:[%08lX:%08lX:%08lX:%08lX]%p:%s (export)\n",ok,alg_k,alg_a,emask_k,emask_a,
3854 ok = (alg_k & mask_k) && (alg_a & mask_a);
3856 printf(
"%d:[%08lX:%08lX:%08lX:%08lX]%p:%s\n",ok,alg_k,alg_a,mask_k,mask_a,(
void *)c,
3861 #ifndef OPENSSL_NO_TLSEXT
3862 #ifndef OPENSSL_NO_EC
3951 if ((ec_search1 != 0) || (ec_search2 != 0))
3998 if ((ec_search1 != 0) || (ec_search2 != 0))
4029 unsigned long alg_k;
4033 #ifndef OPENSSL_NO_GOST
4045 #ifndef OPENSSL_NO_DH
4048 # ifndef OPENSSL_NO_RSA
4051 # ifndef OPENSSL_NO_DSA
4058 # ifndef OPENSSL_NO_RSA
4061 # ifndef OPENSSL_NO_DSA
4066 #ifndef OPENSSL_NO_RSA
4069 #ifndef OPENSSL_NO_DSA
4072 #ifndef OPENSSL_NO_ECDH
4080 #ifndef OPENSSL_NO_ECDSA
4152 if (s->
shutdown & SSL_SEND_SHUTDOWN)
4173 if (ret <= 0)
return(ret);
4180 if (n <= 0)
return(n);
4194 if (ret <= 0)
return(ret);
4200 static int ssl3_read_internal(
SSL *s,
void *buf,
int len,
int peek)
4227 return ssl3_read_internal(s, buf, len, 0);
4232 return ssl3_read_internal(s, buf, len, 1);