File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -390,6 +390,7 @@ const struct s2n_cipher s2n_aes128_gcm = {
390390 .set_encryption_key = s2n_aead_cipher_aes128_gcm_set_encryption_key ,
391391 .set_decryption_key = s2n_aead_cipher_aes128_gcm_set_decryption_key ,
392392 .destroy_key = s2n_aead_cipher_aes_gcm_destroy_key ,
393+ .ktls_supported = true,
393394};
394395
395396const struct s2n_cipher s2n_aes256_gcm = {
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ struct s2n_cipher {
8181 struct s2n_composite_cipher comp ;
8282 } io ;
8383 uint8_t key_material_size ;
84+ bool ktls_supported ;
8485 uint8_t (* is_available )(void );
8586 int (* init )(struct s2n_session_key * key );
8687 int (* set_decryption_key )(struct s2n_session_key * key , struct s2n_blob * in );
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License").
5+ * You may not use this file except in compliance with the License.
6+ * A copy of the License is located at
7+ *
8+ * http://aws.amazon.com/apache2.0
9+ *
10+ * or in the "license" file accompanying this file. This file is distributed
11+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+ * express or implied. See the License for the specific language governing
13+ * permissions and limitations under the License.
14+ */
15+
16+ #include "crypto/s2n_cipher.h"
17+ #include "s2n_test.h"
18+
19+ int main (int argc , char * * argv )
20+ {
21+ BEGIN_TEST ();
22+
23+ /* ktls_supported ciphers */
24+ {
25+ struct s2n_cipher cipher = s2n_aes128_gcm ;
26+ EXPECT_TRUE (cipher .ktls_supported );
27+
28+ cipher = s2n_aes256_gcm ;
29+ EXPECT_FALSE (cipher .ktls_supported );
30+
31+ cipher = s2n_tls13_aes128_gcm ;
32+ EXPECT_FALSE (cipher .ktls_supported );
33+
34+ cipher = s2n_tls13_aes256_gcm ;
35+ EXPECT_FALSE (cipher .ktls_supported );
36+
37+ cipher = s2n_chacha20_poly1305 ;
38+ EXPECT_FALSE (cipher .ktls_supported );
39+ };
40+
41+ END_TEST ();
42+ }
You can’t perform that action at this time.
0 commit comments