@@ -518,8 +518,9 @@ tls_ctx_restrict_ciphers_tls13(struct tls_root_ctx *ctx, const char *ciphers)
518518void
519519tls_ctx_set_cert_profile (struct tls_root_ctx * ctx , const char * profile )
520520{
521- #if OPENSSL_VERSION_NUMBER > 0x10100000L \
522- && (!defined(LIBRESSL_VERSION_NUMBER ) || LIBRESSL_VERSION_NUMBER > 0x3060000fL )
521+ #if OPENSSL_VERSION_NUMBER > 0x10100000L \
522+ && (!defined(LIBRESSL_VERSION_NUMBER ) || LIBRESSL_VERSION_NUMBER > 0x3060000fL ) \
523+ && !defined(OPENSSL_IS_AWSLC )
523524 /* OpenSSL does not have certificate profiles, but a complex set of
524525 * callbacks that we could try to implement to achieve something similar.
525526 * For now, use OpenSSL's security levels to achieve similar (but not equal)
@@ -549,7 +550,7 @@ tls_ctx_set_cert_profile(struct tls_root_ctx *ctx, const char *profile)
549550 if (profile )
550551 {
551552 msg (M_WARN ,
552- "WARNING: OpenSSL 1.1.0 and LibreSSL do not support "
553+ "WARNING: OpenSSL 1.1.0, aws-lc and LibreSSL do not support "
553554 "--tls-cert-profile, ignoring user-set profile: '%s'" ,
554555 profile );
555556 }
@@ -906,7 +907,6 @@ tls_ctx_load_pkcs12(struct tls_root_ctx *ctx, const char *pkcs12_file, bool pkcs
906907 X509 * cert ;
907908 STACK_OF (X509 ) * ca = NULL ;
908909 PKCS12 * p12 ;
909- int i ;
910910 char password [256 ];
911911
912912 ASSERT (NULL != ctx );
@@ -990,7 +990,7 @@ tls_ctx_load_pkcs12(struct tls_root_ctx *ctx, const char *pkcs12_file, bool pkcs
990990 */
991991 if (ca && sk_X509_num (ca ))
992992 {
993- for (i = 0 ; i < sk_X509_num (ca ); i ++ )
993+ for (size_t i = 0 ; i < ( size_t ) sk_X509_num (ca ); i ++ )
994994 {
995995 X509_STORE * cert_store = SSL_CTX_get_cert_store (ctx -> ctx );
996996 if (!X509_STORE_add_cert (cert_store , sk_X509_value (ca , i )))
@@ -1015,7 +1015,7 @@ tls_ctx_load_pkcs12(struct tls_root_ctx *ctx, const char *pkcs12_file, bool pkcs
10151015 */
10161016 if (ca && sk_X509_num (ca ))
10171017 {
1018- for (i = 0 ; i < sk_X509_num (ca ); i ++ )
1018+ for (size_t i = 0 ; i < ( size_t ) sk_X509_num (ca ); i ++ )
10191019 {
10201020 if (!SSL_CTX_add_extra_chain_cert (ctx -> ctx , sk_X509_value (ca , i )))
10211021 {
@@ -1331,7 +1331,7 @@ backend_tls_ctx_reload_crl(struct tls_root_ctx *ssl_ctx, const char *crl_file, b
13311331 * we need to manually find the CRL object from the stack
13321332 * and remove it */
13331333 STACK_OF (X509_OBJECT ) * objs = X509_STORE_get0_objects (store );
1334- for (int i = 0 ; i < sk_X509_OBJECT_num (objs ); i ++ )
1334+ for (size_t i = 0 ; i < ( size_t ) sk_X509_OBJECT_num (objs ); i ++ )
13351335 {
13361336 X509_OBJECT * obj = sk_X509_OBJECT_value (objs , i );
13371337 ASSERT (obj );
@@ -1591,7 +1591,7 @@ static int
15911591ecdsa_sign (int type , const unsigned char * dgst , int dgstlen , unsigned char * sig ,
15921592 unsigned int * siglen , const BIGNUM * kinv , const BIGNUM * r , EC_KEY * ec )
15931593{
1594- int capacity = ECDSA_size (ec );
1594+ int capacity = ( int ) ECDSA_size (ec );
15951595 /*
15961596 * ECDSA does not seem to have proper constants for paddings since
15971597 * there are only signatures without padding at the moment, use
@@ -1607,12 +1607,14 @@ ecdsa_sign(int type, const unsigned char *dgst, int dgstlen, unsigned char *sig,
16071607 return 0 ;
16081608}
16091609
1610+ #ifndef OPENSSL_IS_AWSLC
16101611/* EC_KEY_METHOD callback: sign_setup(). We do no precomputations */
16111612static int
16121613ecdsa_sign_setup (EC_KEY * ec , BN_CTX * ctx_in , BIGNUM * * kinvp , BIGNUM * * rp )
16131614{
16141615 return 1 ;
16151616}
1617+ #endif
16161618
16171619/* EC_KEY_METHOD callback: sign_sig().
16181620 * Sign the hash and return the result as a newly allocated ECDS_SIG
@@ -1623,7 +1625,7 @@ ecdsa_sign_sig(const unsigned char *dgst, int dgstlen, const BIGNUM *in_kinv, co
16231625 EC_KEY * ec )
16241626{
16251627 ECDSA_SIG * ecsig = NULL ;
1626- unsigned int len = ECDSA_size (ec );
1628+ unsigned int len = ( unsigned int ) ECDSA_size (ec );
16271629 struct gc_arena gc = gc_new ();
16281630
16291631 unsigned char * buf = gc_malloc (len , false, & gc );
@@ -1790,7 +1792,7 @@ tls_ctx_load_ca(struct tls_root_ctx *ctx, const char *ca_file, bool ca_file_inli
17901792 X509_STORE * store = NULL ;
17911793 X509_NAME * xn = NULL ;
17921794 BIO * in = NULL ;
1793- int i , added = 0 , prev = 0 ;
1795+ size_t added = 0 , prev = 0 ;
17941796
17951797 ASSERT (NULL != ctx );
17961798
@@ -1819,7 +1821,7 @@ tls_ctx_load_ca(struct tls_root_ctx *ctx, const char *ca_file, bool ca_file_inli
18191821
18201822 if (info_stack )
18211823 {
1822- for (i = 0 ; i < sk_X509_INFO_num (info_stack ); i ++ )
1824+ for (size_t i = 0 ; i < ( size_t ) sk_X509_INFO_num (info_stack ); i ++ )
18231825 {
18241826 X509_INFO * info = sk_X509_INFO_value (info_stack , i );
18251827 if (info -> crl )
@@ -1872,19 +1874,19 @@ tls_ctx_load_ca(struct tls_root_ctx *ctx, const char *ca_file, bool ca_file_inli
18721874
18731875 if (tls_server )
18741876 {
1875- int cnum = sk_X509_NAME_num (cert_names );
1877+ size_t cnum = sk_X509_NAME_num (cert_names );
18761878 if (cnum != (prev + 1 ))
18771879 {
18781880 crypto_msg (M_WARN ,
1879- "Cannot load CA certificate file %s (entry %d did not validate)" ,
1881+ "Cannot load CA certificate file %s (entry %zu did not validate)" ,
18801882 print_key_filename (ca_file , ca_file_inline ), added );
18811883 }
18821884 prev = cnum ;
18831885 }
18841886 }
18851887 sk_X509_INFO_pop_free (info_stack , X509_INFO_free );
18861888 }
1887- int cnum ;
1889+ size_t cnum ;
18881890 if (tls_server )
18891891 {
18901892 cnum = sk_X509_NAME_num (cert_names );
@@ -1902,8 +1904,8 @@ tls_ctx_load_ca(struct tls_root_ctx *ctx, const char *ca_file, bool ca_file_inli
19021904 if (cnum != added )
19031905 {
19041906 crypto_msg (M_FATAL ,
1905- "Cannot load CA certificate file %s (only %d "
1906- "of %d entries were valid X509 names)" ,
1907+ "Cannot load CA certificate file %s (only %zu "
1908+ "of %zu entries were valid X509 names)" ,
19071909 print_key_filename (ca_file , ca_file_inline ), cnum , added );
19081910 }
19091911 }
@@ -2552,7 +2554,7 @@ show_available_tls_ciphers_list(const char *cipher_list, const char *tls_cert_pr
25522554#else
25532555 STACK_OF (SSL_CIPHER ) * sk = SSL_get1_supported_ciphers (ssl );
25542556#endif
2555- for (int i = 0 ; i < sk_SSL_CIPHER_num (sk ); i ++ )
2557+ for (size_t i = 0 ; i < ( size_t ) sk_SSL_CIPHER_num (sk ); i ++ )
25562558 {
25572559 const SSL_CIPHER * c = sk_SSL_CIPHER_value (sk , i );
25582560
0 commit comments