Skip to content

Commit 949745b

Browse files
encrypt: broken IPsec algo removed
The MD5 and SHA1 IPsec algorithms removed as they are known broken. Signed-off-by: viktor-kurchenko <[email protected]>
1 parent 9316d0a commit 949745b

File tree

3 files changed

+1
-49
lines changed

3 files changed

+1
-49
lines changed

Diff for: cli/encrypt.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func newCmdIPsecRotateKey() *cobra.Command {
6969
return nil
7070
},
7171
}
72-
cmd.Flags().StringVarP(&params.IPsecKeyAuthAlgo, "auth-algo", "", "", "IPsec key authentication algorithm (optional parameter, if omitted the current settings will be used). One of: gcm-aes, hmac-md5, hmac-sha1, hmac-sha256, hmac-sha512")
72+
cmd.Flags().StringVarP(&params.IPsecKeyAuthAlgo, "auth-algo", "", "", "IPsec key authentication algorithm (optional parameter, if omitted the current settings will be used). One of: gcm-aes, hmac-sha256, hmac-sha512")
7373
cmd.Flags().StringVarP(&params.IPsecKeyPerNode, "key-per-node", "", "", "IPsec key per cluster node (optional parameter, if omitted the current settings will be used). One of: true, false")
7474
_ = cmd.Flags().MarkHidden("key-per-node")
7575
cmd.Flags().DurationVar(&params.WaitDuration, "wait-duration", 1*time.Minute, "Maximum time to wait for result, default 1 minute")

Diff for: encrypt/ipsec_key_rotator.go

-10
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ package encrypt
66
var rotators = map[string]func(key ipsecKey) (ipsecKey, error){
77
"": func(key ipsecKey) (ipsecKey, error) { return key.rotate() },
88
"gcm-aes": newGcmAesKey,
9-
"hmac-md5": newHmacMD5Key,
10-
"hmac-sha1": newHmacSHA1Key,
119
"hmac-sha256": newHmacSHA256Key,
1210
"hmac-sha512": newHmacSHA512Key,
1311
}
@@ -36,14 +34,6 @@ func newGcmAesKey(key ipsecKey) (ipsecKey, error) {
3634
return newKey, nil
3735
}
3836

39-
func newHmacMD5Key(key ipsecKey) (ipsecKey, error) {
40-
return newCbcAesKey(key, "hmac(md5)", 16, 32)
41-
}
42-
43-
func newHmacSHA1Key(key ipsecKey) (ipsecKey, error) {
44-
return newCbcAesKey(key, "hmac(sha1)", 20, 32)
45-
}
46-
4737
func newHmacSHA256Key(key ipsecKey) (ipsecKey, error) {
4838
return newCbcAesKey(key, "hmac(sha256)", 32, 32)
4939
}

Diff for: encrypt/ipsec_key_rotator_test.go

-38
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ func Test_IsIPsecAlgoSupported(t *testing.T) {
2222
have: "gcm-aes",
2323
expected: true,
2424
},
25-
{
26-
have: "hmac-md5",
27-
expected: true,
28-
},
29-
{
30-
have: "hmac-sha1",
31-
expected: true,
32-
},
3325
{
3426
have: "hmac-sha256",
3527
expected: true,
@@ -216,36 +208,6 @@ func Test_rotateIPsecKey(t *testing.T) {
216208
size: 128,
217209
},
218210
},
219-
{
220-
haveAlgo: "hmac-md5",
221-
haveKey: ipsecKey{
222-
spi: 1,
223-
spiSuffix: true,
224-
},
225-
expected: ipsecKey{
226-
spi: 2,
227-
spiSuffix: true,
228-
algo: "hmac(md5)",
229-
key: "1286b7f6f9f61a4f",
230-
cipherMode: "cbc(aes)",
231-
cipherKey: "efbeeb4230992f76a6e4cc2ff995b756",
232-
},
233-
},
234-
{
235-
haveAlgo: "hmac-sha1",
236-
haveKey: ipsecKey{
237-
spi: 2,
238-
spiSuffix: true,
239-
},
240-
expected: ipsecKey{
241-
spi: 3,
242-
spiSuffix: true,
243-
algo: "hmac(sha1)",
244-
key: "5448dd20e4528a9c2d5b",
245-
cipherMode: "cbc(aes)",
246-
cipherKey: "123d17f2bbbae8009d952b4d0d656f06",
247-
},
248-
},
249211
{
250212
haveAlgo: "hmac-sha256",
251213
haveKey: ipsecKey{

0 commit comments

Comments
 (0)