Skip to content

Commit

Permalink
Cisco IOS Fix missing extraction case for pfs group20 (#7994)
Browse files Browse the repository at this point in the history
  • Loading branch information
arifogel committed Feb 2, 2022
1 parent 4ba453e commit 405b50b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9376,6 +9376,8 @@ private DiffieHellmanGroup toDhGroup(Dh_groupContext ctx) {
return DiffieHellmanGroup.GROUP19;
} else if (ctx.GROUP2() != null) {
return DiffieHellmanGroup.GROUP2;
} else if (ctx.GROUP20() != null) {
return DiffieHellmanGroup.GROUP20;
} else if (ctx.GROUP21() != null) {
return DiffieHellmanGroup.GROUP21;
} else if (ctx.GROUP24() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4087,6 +4087,12 @@ public void testToIpsecPolicies() throws IOException {
IpsecPhase2PolicyMatchers.hasPfsKeyGroup(equalTo(DiffieHellmanGroup.GROUP2)))));
}

@Test
public void testCryptoMapPfsDhGroupParsing() {
// don't crash
parseCiscoConfig("ios-crypto-map-pfs-dh-group", ConfigurationFormat.CISCO_IOS);
}

@Test
public void testCryptoMapsAndTunnelsToIpsecPeerConfigs() throws IOException {
Configuration c = parseConfig("ios-crypto-map");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
!
hostname ios-crypto-map-pfs-dh-group
!
crypto map mymap 10 ipsec-isakmp
set pfs group1
set pfs group14
set pfs group15
set pfs group16
set pfs group19
set pfs group2
set pfs group20
set pfs group21
set pfs group24
set pfs group5
!

0 comments on commit 405b50b

Please sign in to comment.