mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-30 23:00:59 +00:00
Add missing ifdefs in ssl modules
This commit is contained in:
parent
59da0a46a4
commit
5fd4917d97
|
@ -1289,9 +1289,11 @@ static int ssl_parse_client_hello( ssl_context *ssl )
|
||||||
ciphersuite_info->max_minor_ver < ssl->minor_ver )
|
ciphersuite_info->max_minor_ver < ssl->minor_ver )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
#if defined(POLARSSL_ECDH_C) || defined(POLARSSL_ECDSA_C)
|
||||||
if( ( ciphersuite_info->flags & POLARSSL_CIPHERSUITE_EC ) &&
|
if( ( ciphersuite_info->flags & POLARSSL_CIPHERSUITE_EC ) &&
|
||||||
ssl->handshake->ec_curve == 0 )
|
ssl->handshake->ec_curve == 0 )
|
||||||
continue;
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
goto have_ciphersuite;
|
goto have_ciphersuite;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1011,6 +1011,7 @@ static int ssl_encrypt_buf( ssl_context *ssl )
|
||||||
|
|
||||||
switch( ssl->transform_out->ciphersuite_info->cipher )
|
switch( ssl->transform_out->ciphersuite_info->cipher )
|
||||||
{
|
{
|
||||||
|
#if defined(POLARSSL_DES_C)
|
||||||
case POLARSSL_CIPHER_DES_CBC:
|
case POLARSSL_CIPHER_DES_CBC:
|
||||||
des_crypt_cbc( (des_context *) ssl->transform_out->ctx_enc,
|
des_crypt_cbc( (des_context *) ssl->transform_out->ctx_enc,
|
||||||
DES_ENCRYPT, enc_msglen,
|
DES_ENCRYPT, enc_msglen,
|
||||||
|
@ -1022,20 +1023,25 @@ static int ssl_encrypt_buf( ssl_context *ssl )
|
||||||
DES_ENCRYPT, enc_msglen,
|
DES_ENCRYPT, enc_msglen,
|
||||||
ssl->transform_out->iv_enc, enc_msg, enc_msg );
|
ssl->transform_out->iv_enc, enc_msg, enc_msg );
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(POLARSSL_AES_C)
|
||||||
case POLARSSL_CIPHER_AES_128_CBC:
|
case POLARSSL_CIPHER_AES_128_CBC:
|
||||||
case POLARSSL_CIPHER_AES_256_CBC:
|
case POLARSSL_CIPHER_AES_256_CBC:
|
||||||
aes_crypt_cbc( (aes_context *) ssl->transform_out->ctx_enc,
|
aes_crypt_cbc( (aes_context *) ssl->transform_out->ctx_enc,
|
||||||
AES_ENCRYPT, enc_msglen,
|
AES_ENCRYPT, enc_msglen,
|
||||||
ssl->transform_out->iv_enc, enc_msg, enc_msg );
|
ssl->transform_out->iv_enc, enc_msg, enc_msg );
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(POLARSSL_CAMELLIA_C)
|
||||||
case POLARSSL_CIPHER_CAMELLIA_128_CBC:
|
case POLARSSL_CIPHER_CAMELLIA_128_CBC:
|
||||||
case POLARSSL_CIPHER_CAMELLIA_256_CBC:
|
case POLARSSL_CIPHER_CAMELLIA_256_CBC:
|
||||||
camellia_crypt_cbc( (camellia_context *) ssl->transform_out->ctx_enc,
|
camellia_crypt_cbc( (camellia_context *) ssl->transform_out->ctx_enc,
|
||||||
CAMELLIA_ENCRYPT, enc_msglen,
|
CAMELLIA_ENCRYPT, enc_msglen,
|
||||||
ssl->transform_out->iv_enc, enc_msg, enc_msg );
|
ssl->transform_out->iv_enc, enc_msg, enc_msg );
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return( POLARSSL_ERR_SSL_FEATURE_UNAVAILABLE );
|
return( POLARSSL_ERR_SSL_FEATURE_UNAVAILABLE );
|
||||||
|
@ -1188,6 +1194,7 @@ static int ssl_decrypt_buf( ssl_context *ssl )
|
||||||
|
|
||||||
switch( ssl->transform_in->ciphersuite_info->cipher )
|
switch( ssl->transform_in->ciphersuite_info->cipher )
|
||||||
{
|
{
|
||||||
|
#if defined(POLARSSL_DES_C)
|
||||||
case POLARSSL_CIPHER_DES_CBC:
|
case POLARSSL_CIPHER_DES_CBC:
|
||||||
des_crypt_cbc( (des_context *) ssl->transform_in->ctx_dec,
|
des_crypt_cbc( (des_context *) ssl->transform_in->ctx_dec,
|
||||||
DES_DECRYPT, dec_msglen,
|
DES_DECRYPT, dec_msglen,
|
||||||
|
@ -1199,20 +1206,25 @@ static int ssl_decrypt_buf( ssl_context *ssl )
|
||||||
DES_DECRYPT, dec_msglen,
|
DES_DECRYPT, dec_msglen,
|
||||||
ssl->transform_in->iv_dec, dec_msg, dec_msg_result );
|
ssl->transform_in->iv_dec, dec_msg, dec_msg_result );
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(POLARSSL_AES_C)
|
||||||
case POLARSSL_CIPHER_AES_128_CBC:
|
case POLARSSL_CIPHER_AES_128_CBC:
|
||||||
case POLARSSL_CIPHER_AES_256_CBC:
|
case POLARSSL_CIPHER_AES_256_CBC:
|
||||||
aes_crypt_cbc( (aes_context *) ssl->transform_in->ctx_dec,
|
aes_crypt_cbc( (aes_context *) ssl->transform_in->ctx_dec,
|
||||||
AES_DECRYPT, dec_msglen,
|
AES_DECRYPT, dec_msglen,
|
||||||
ssl->transform_in->iv_dec, dec_msg, dec_msg_result );
|
ssl->transform_in->iv_dec, dec_msg, dec_msg_result );
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(POLARSSL_CAMELLIA_C)
|
||||||
case POLARSSL_CIPHER_CAMELLIA_128_CBC:
|
case POLARSSL_CIPHER_CAMELLIA_128_CBC:
|
||||||
case POLARSSL_CIPHER_CAMELLIA_256_CBC:
|
case POLARSSL_CIPHER_CAMELLIA_256_CBC:
|
||||||
camellia_crypt_cbc( (camellia_context *) ssl->transform_in->ctx_dec,
|
camellia_crypt_cbc( (camellia_context *) ssl->transform_in->ctx_dec,
|
||||||
CAMELLIA_DECRYPT, dec_msglen,
|
CAMELLIA_DECRYPT, dec_msglen,
|
||||||
ssl->transform_in->iv_dec, dec_msg, dec_msg_result );
|
ssl->transform_in->iv_dec, dec_msg, dec_msg_result );
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return( POLARSSL_ERR_SSL_FEATURE_UNAVAILABLE );
|
return( POLARSSL_ERR_SSL_FEATURE_UNAVAILABLE );
|
||||||
|
|
Loading…
Reference in a new issue