Skip to content

Commit

Permalink
feat: Adding aes-128-gcm / aes-256-gcm options to ike profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
shinmog committed Dec 8, 2021
1 parent 267c9a2 commit e86d475
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 7 additions & 5 deletions netw/profile/ike/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions netw/profile/ike/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand Down Expand Up @@ -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]
}
Expand Down

0 comments on commit e86d475

Please sign in to comment.