X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fplugins%2Ftlspicotls%2Fpico_vpp_crypto.c;h=3d28d50b352c0f0c496284f3237b60191547cc5a;hb=06bbab0c45c805544c981b8765ea3d85760d66a8;hp=f3514d07b23aa6d57f5c525da08892e44af8df50;hpb=7f347c13dfb39aac1d2507068a2b6ae2baa09af4;p=vpp.git diff --git a/src/plugins/tlspicotls/pico_vpp_crypto.c b/src/plugins/tlspicotls/pico_vpp_crypto.c index f3514d07b23..3d28d50b352 100644 --- a/src/plugins/tlspicotls/pico_vpp_crypto.c +++ b/src/plugins/tlspicotls/pico_vpp_crypto.c @@ -197,7 +197,12 @@ ptls_vpp_crypto_aead_encrypt_final (ptls_aead_context_t * _ctx, void *_output) static void ptls_vpp_crypto_aead_dispose_crypto (ptls_aead_context_t * _ctx) { - /* Do nothing */ + vlib_main_t *vm = vlib_get_main (); + struct vpp_aead_context_t *ctx = (struct vpp_aead_context_t *) _ctx; + + clib_rwlock_writer_lock (&picotls_main.crypto_keys_rw_lock); + vnet_crypto_key_del (vm, ctx->key_index); + clib_rwlock_writer_unlock (&picotls_main.crypto_keys_rw_lock); } static int @@ -301,6 +306,7 @@ ptls_cipher_algorithm_t ptls_vpp_crypto_aes256ctr = { ptls_vpp_crypto_aes256ctr_setup_crypto }; +#define PTLS_X86_CACHE_LINE_ALIGN_BITS 6 ptls_aead_algorithm_t ptls_vpp_crypto_aes128gcm = { "AES128-GCM", PTLS_AESGCM_CONFIDENTIALITY_LIMIT, @@ -310,6 +316,9 @@ ptls_aead_algorithm_t ptls_vpp_crypto_aes128gcm = { PTLS_AES128_KEY_SIZE, PTLS_AESGCM_IV_SIZE, PTLS_AESGCM_TAG_SIZE, + { PTLS_TLS12_AESGCM_FIXED_IV_SIZE, PTLS_TLS12_AESGCM_RECORD_IV_SIZE }, + 1, + PTLS_X86_CACHE_LINE_ALIGN_BITS, sizeof (struct vpp_aead_context_t), ptls_vpp_crypto_aead_aes128gcm_setup_crypto }; @@ -323,6 +332,9 @@ ptls_aead_algorithm_t ptls_vpp_crypto_aes256gcm = { PTLS_AES256_KEY_SIZE, PTLS_AESGCM_IV_SIZE, PTLS_AESGCM_TAG_SIZE, + { PTLS_TLS12_AESGCM_FIXED_IV_SIZE, PTLS_TLS12_AESGCM_RECORD_IV_SIZE }, + 1, + PTLS_X86_CACHE_LINE_ALIGN_BITS, sizeof (struct vpp_aead_context_t), ptls_vpp_crypto_aead_aes256gcm_setup_crypto };