From e86d4755aaf95090588fdfc78cb18ce8154b60b8 Mon Sep 17 00:00:00 2001 From: Garfield Freeman Date: Wed, 8 Dec 2021 14:08:35 -0800 Subject: [PATCH] feat: Adding aes-128-gcm / aes-256-gcm options to ike profiles --- netw/profile/ike/const.go | 12 +++++++----- netw/profile/ike/entry.go | 8 ++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/netw/profile/ike/const.go b/netw/profile/ike/const.go index c18107bb..bb19089e 100644 --- a/netw/profile/ike/const.go +++ b/netw/profile/ike/const.go @@ -2,11 +2,13 @@ package ike // Valid Entryption values. const ( - EncryptionDes = "des" - Encryption3des = "3des" - EncryptionAes128 = "aes-128-cbc" - EncryptionAes192 = "aes-192-cbc" - EncryptionAes256 = "aes-256-cbc" + EncryptionDes = "des" + Encryption3des = "3des" + EncryptionAes128 = "aes-128-cbc" + EncryptionAes192 = "aes-192-cbc" + EncryptionAes256 = "aes-256-cbc" + EncryptionAes128Gcm = "aes-128-gcm" + EncryptionAes256Gcm = "aes-256-gcm" ) // Valid Time values. diff --git a/netw/profile/ike/entry.go b/netw/profile/ike/entry.go index a1128b1d..70a2d425 100644 --- a/netw/profile/ike/entry.go +++ b/netw/profile/ike/entry.go @@ -78,6 +78,10 @@ func specifyEncryption(vals []string, v int) []string { nv[i] = "aes-192-cbc" case EncryptionAes256: nv[i] = "aes-256-cbc" + case EncryptionAes128Gcm: + nv[i] = "aes-128-gcm" + case EncryptionAes256Gcm: + nv[i] = "aes-256-gcm" default: nv[i] = vals[i] } @@ -122,6 +126,10 @@ func normalizeEncryption(v []string) []string { ans[i] = EncryptionAes192 case "aes-256-cbc", "aes256": ans[i] = EncryptionAes256 + case "aes-128-gcm": + ans[i] = EncryptionAes128Gcm + case "aes-256-gcm": + ans[i] = EncryptionAes256Gcm default: ans[i] = v[i] }