Thread (21 messages) 21 messages, 2 authors, 2022-02-17

Re: [PATCH net-next v6 7/8] net/funeth: add kTLS TX control part

From: Dimitris Michailidis <hidden>
Date: 2022-02-17 03:10:34

On Wed, Jan 12, 2022 at 2:40 PM Jakub Kicinski [off-list ref] wrote:
On Wed, 12 Jan 2022 14:35:32 -0800 Jakub Kicinski wrote:
quoted
quoted
+   if (crypto_info->version == TLS_1_2_VERSION)
+           req.version = FUN_KTLS_TLSV2;
+   else if (crypto_info->version == TLS_1_3_VERSION)
+           req.version = FUN_KTLS_TLSV3;
I don't think offload of TLS 1.3 is supported by the kernel.
quoted
quoted
+   else
+           return -EOPNOTSUPP;
+
+   switch (crypto_info->cipher_type) {
+   case TLS_CIPHER_AES_GCM_128: {
+           struct tls12_crypto_info_aes_gcm_128 *c = (void *)crypto_info;
+
+           req.cipher = FUN_KTLS_CIPHER_AES_GCM_128;
+           memcpy(req.key, c->key, sizeof(c->key));
+           memcpy(req.iv, c->iv, sizeof(c->iv));
+           memcpy(req.salt, c->salt, sizeof(c->salt));
+           memcpy(req.record_seq, c->rec_seq, sizeof(c->rec_seq));
+           break;
+   }
Neither are all the algos below. Please remove dead code.
I've removed the TLS 1.3 pieces and the non-offloaded 1.2 algos.
quoted
quoted
+   case TLS_CIPHER_AES_GCM_256: {
+           struct tls12_crypto_info_aes_gcm_256 *c = (void *)crypto_info;
+
+           req.cipher = FUN_KTLS_CIPHER_AES_GCM_256;
+           memcpy(req.key, c->key, sizeof(c->key));
+           memcpy(req.iv, c->iv, sizeof(c->iv));
+           memcpy(req.salt, c->salt, sizeof(c->salt));
+           memcpy(req.record_seq, c->rec_seq, sizeof(c->rec_seq));
+           break;
+   }
+
+   case TLS_CIPHER_CHACHA20_POLY1305: {
+           struct tls12_crypto_info_chacha20_poly1305 *c;
+
+           c = (void *)crypto_info;
+           req.cipher = FUN_KTLS_CIPHER_CHACHA20_POLY1305;
+           memcpy(req.key, c->key, sizeof(c->key));
+           memcpy(req.iv, c->iv, sizeof(c->iv));
+           memcpy(req.salt, c->salt, sizeof(c->salt));
+           memcpy(req.record_seq, c->rec_seq, sizeof(c->rec_seq));
+           break;
+   }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help