60 #define MAX_CIPHERSUITE_TBLSIZE 64
82 DESCRIPTION(
"TLS_DHE_RSA_WITH_AES_128_CBC_SHA256" )
100 DESCRIPTION(
"TLS_DHE_RSA_WITH_AES_256_CBC_SHA256" )
128 DESCRIPTION(
"TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA" )
133 DESCRIPTION(
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" )
143 DESCRIPTION(
"TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" )
148 DESCRIPTION(
"TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" )
189 DESCRIPTION(
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" )
201 DESCRIPTION(
"TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" )
327 CIPHERSUITE_FLAG_TLS12 },
332 CIPHERSUITE_FLAG_TLS12 },
384 const int cipherSuiteCount;
387 static const CIPHERSUITES_LIST cipherSuitesList[] = {
389 #if defined( PREFER_ECC ) && defined( USE_ECDH ) && defined( USE_ECDSA )
395 #ifdef PREFER_RSA_TO_DH
402 #if !defined( PREFER_ECC ) && defined( USE_ECDH ) && defined( USE_ECDSA )
410 { NULL, 0 }, { NULL, 0 }
422 #if defined( CONFIG_SUITEB )
424 #if defined( _MSC_VER )
425 #pragma message( " Building with custom suite: Suite B" )
426 #if defined( CONFIG_SUITEB_TESTS )
427 #pragma message( " Building with custom suite: Suite B test suites" )
435 DESCRIPTION(
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" )
445 DESCRIPTION(
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" )
470 { &suiteBP384GCM, &suiteBEOL, &suiteBEOL };
472 { &suiteBP256GCM, &suiteBP384GCM, &suiteBEOL, &suiteBEOL };
476 assert(
isReadPtr( cipherSuiteInfoPtrPtrPtr, \
478 assert(
isWritePtr( noSuiteEntries,
sizeof(
int ) ) );
487 cipherSuite128InfoTbl;
494 cipherSuite192InfoTbl;
504 #undef getCipherSuiteInfo
505 #define getCipherSuiteInfo getCipherSuiteInfoOriginal
520 IN_RANGE( 0, MAX_CIPHERSUITE_TBLSIZE ) \
521 const int cipherSuiteTblCount,
522 OUT_RANGE( 0, MAX_CIPHERSUITE_TBLSIZE ) \
523 int *newCipherSuiteTblCount,
525 IN_RANGE( 0, MAX_CIPHERSUITE_TBLSIZE / 2 ) \
526 const int cipherSuitesCount )
528 int srcIndex, destIndex;
532 assert(
isWritePtr( newCipherSuiteTblCount,
sizeof(
int ) ) );
536 REQUIRES( cipherSuiteTblCount >= 0 && \
537 cipherSuiteTblCount < MAX_CIPHERSUITE_TBLSIZE );
538 REQUIRES( cipherSuitesCount >= 0 && \
539 cipherSuitesCount < MAX_CIPHERSUITE_TBLSIZE / 2 );
543 *newCipherSuiteTblCount = cipherSuiteTblCount;
546 for( srcIndex = 0, destIndex = cipherSuiteTblCount;
548 srcIndex < cipherSuitesCount && destIndex < MAX_CIPHERSUITE_TBLSIZE;
549 srcIndex++, destIndex++ )
552 &cipherSuites[ srcIndex ];
554 ENSURES( srcIndex < cipherSuitesCount );
555 ENSURES( destIndex < MAX_CIPHERSUITE_TBLSIZE );
557 *newCipherSuiteTblCount = destIndex;
569 static int cipherSuiteCount = 0;
572 assert(
isReadPtr( cipherSuiteInfoPtrPtrPtr, \
574 assert(
isWritePtr( noSuiteEntries,
sizeof(
int ) ) );
581 if( !cipherSuitInfoInited )
592 cipherSuitesList[ i ].cipherSuites != NULL && \
596 status = addCipherSuiteInfo( cipherSuiteInfoTbl, cipherSuiteCount,
597 &cipherSuiteCount, cipherSuitesList[ i ].cipherSuites,
598 cipherSuitesList[ i ].cipherSuiteCount );
607 REQUIRES( cipherSuiteCount + 2 < MAX_CIPHERSUITE_TBLSIZE );
608 cipherSuiteInfoTbl[ cipherSuiteCount++ ] = \
610 cipherSuiteInfoTbl[ cipherSuiteCount ] = \
613 cipherSuitInfoInited =
TRUE;
618 *noSuiteEntries = cipherSuiteCount;