Added macro that indicates presence of the time callback feature. Also added C++...
[BearSSL] / src / ssl / ssl_server_full_rsa.c
index 6b0f59a..d67c076 100644 (file)
@@ -53,6 +53,10 @@ br_ssl_server_init_full_rsa(br_ssl_server_context *cc,
                BR_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
                BR_TLS_RSA_WITH_AES_128_GCM_SHA256,
                BR_TLS_RSA_WITH_AES_256_GCM_SHA384,
+               BR_TLS_RSA_WITH_AES_128_CCM,
+               BR_TLS_RSA_WITH_AES_256_CCM,
+               BR_TLS_RSA_WITH_AES_128_CCM_8,
+               BR_TLS_RSA_WITH_AES_256_CCM_8,
                BR_TLS_RSA_WITH_AES_128_CBC_SHA256,
                BR_TLS_RSA_WITH_AES_256_CBC_SHA256,
                BR_TLS_RSA_WITH_AES_128_CBC_SHA,
@@ -89,7 +93,7 @@ br_ssl_server_init_full_rsa(br_ssl_server_context *cc,
         */
        br_ssl_engine_set_suites(&cc->eng, suites,
                (sizeof suites) / (sizeof suites[0]));
-       br_ssl_engine_set_ec(&cc->eng, &br_ec_prime_i31);
+       br_ssl_engine_set_default_ec(&cc->eng);
 
        /*
         * Set the "server policy": handler for the certificate chain
@@ -97,7 +101,8 @@ br_ssl_server_init_full_rsa(br_ssl_server_context *cc,
         */
        br_ssl_server_set_single_rsa(cc, chain, chain_len, sk,
                BR_KEYTYPE_KEYX | BR_KEYTYPE_SIGN,
-               br_rsa_i31_private, br_rsa_i31_pkcs1_sign);
+               br_rsa_private_get_default(),
+               br_rsa_pkcs1_sign_get_default());
 
        /*
         * Set supported hash functions.
@@ -117,47 +122,11 @@ br_ssl_server_init_full_rsa(br_ssl_server_context *cc,
        br_ssl_engine_set_prf_sha384(&cc->eng, &br_tls12_sha384_prf);
 
        /*
-        * Symmetric encryption. We use the "constant-time"
-        * implementations, which are the safest.
-        *
-        * On architectures detected as "64-bit", use the 64-bit
-        * versions (aes_ct64, ghash_ctmul64).
-        */
-#if BR_64
-       br_ssl_engine_set_aes_cbc(&cc->eng,
-               &br_aes_ct64_cbcenc_vtable,
-               &br_aes_ct64_cbcdec_vtable);
-       br_ssl_engine_set_aes_ctr(&cc->eng,
-               &br_aes_ct64_ctr_vtable);
-       br_ssl_engine_set_ghash(&cc->eng,
-               &br_ghash_ctmul64);
-#else
-       br_ssl_engine_set_aes_cbc(&cc->eng,
-               &br_aes_ct_cbcenc_vtable,
-               &br_aes_ct_cbcdec_vtable);
-       br_ssl_engine_set_aes_ctr(&cc->eng,
-               &br_aes_ct_ctr_vtable);
-       br_ssl_engine_set_ghash(&cc->eng,
-               &br_ghash_ctmul);
-#endif
-       br_ssl_engine_set_des_cbc(&cc->eng,
-               &br_des_ct_cbcenc_vtable,
-               &br_des_ct_cbcdec_vtable);
-       br_ssl_engine_set_chacha20(&cc->eng,
-               &br_chacha20_ct_run);
-       br_ssl_engine_set_poly1305(&cc->eng,
-               &br_poly1305_ctmul_run);
-
-       /*
-        * Set the SSL record engines (CBC, GCM, ChaCha20).
+        * Symmetric encryption.
         */
-       br_ssl_engine_set_cbc(&cc->eng,
-               &br_sslrec_in_cbc_vtable,
-               &br_sslrec_out_cbc_vtable);
-       br_ssl_engine_set_gcm(&cc->eng,
-               &br_sslrec_in_gcm_vtable,
-               &br_sslrec_out_gcm_vtable);
-       br_ssl_engine_set_chapol(&cc->eng,
-               &br_sslrec_in_chapol_vtable,
-               &br_sslrec_out_chapol_vtable);
+       br_ssl_engine_set_default_aes_cbc(&cc->eng);
+       br_ssl_engine_set_default_aes_ccm(&cc->eng);
+       br_ssl_engine_set_default_aes_gcm(&cc->eng);
+       br_ssl_engine_set_default_des_cbc(&cc->eng);
+       br_ssl_engine_set_default_chapol(&cc->eng);
 }