@@ -2290,6 +2290,7 @@ int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx)
22902290 struct tls12_crypto_info_aes_gcm_128 * gcm_128_info ;
22912291 struct tls12_crypto_info_aes_gcm_256 * gcm_256_info ;
22922292 struct tls12_crypto_info_aes_ccm_128 * ccm_128_info ;
2293+ struct tls12_crypto_info_chacha20_poly1305 * chacha20_poly1305_info ;
22932294 struct tls_sw_context_tx * sw_ctx_tx = NULL ;
22942295 struct tls_sw_context_rx * sw_ctx_rx = NULL ;
22952296 struct cipher_context * cctx ;
@@ -2402,6 +2403,21 @@ int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx)
24022403 cipher_name = "ccm(aes)" ;
24032404 break ;
24042405 }
2406+ case TLS_CIPHER_CHACHA20_POLY1305 : {
2407+ chacha20_poly1305_info = (void * )crypto_info ;
2408+ nonce_size = 0 ;
2409+ tag_size = TLS_CIPHER_CHACHA20_POLY1305_TAG_SIZE ;
2410+ iv_size = TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE ;
2411+ iv = chacha20_poly1305_info -> iv ;
2412+ rec_seq_size = TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE ;
2413+ rec_seq = chacha20_poly1305_info -> rec_seq ;
2414+ keysize = TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE ;
2415+ key = chacha20_poly1305_info -> key ;
2416+ salt = chacha20_poly1305_info -> salt ;
2417+ salt_size = TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE ;
2418+ cipher_name = "rfc7539(chacha20,poly1305)" ;
2419+ break ;
2420+ }
24052421 default :
24062422 rc = - EINVAL ;
24072423 goto free_priv ;
0 commit comments