From f0c878a7c2352bb5b2888650c0a385bef26da817 Mon Sep 17 00:00:00 2001 From: Milan Lenco Date: Thu, 6 Aug 2020 16:01:27 +0200 Subject: [PATCH] feat: (ipsec) allow to configure salt for encryption algorithm Signed-off-by: Milan Lenco --- .../vppcalls/vpp1908/dump_vppcalls.go | 1 + .../vppcalls/vpp1908/ipsec_vppcalls.go | 1 + .../vppcalls/vpp2001/dump_vppcalls.go | 1 + .../vppcalls/vpp2001/ipsec_vppcalls.go | 1 + .../vppcalls/vpp2005/dump_vppcalls.go | 3 + .../vppcalls/vpp2005/ipsec_vppcalls.go | 1 + proto/ligato/vpp/ipsec/ipsec.pb.go | 145 ++++++++++-------- proto/ligato/vpp/ipsec/ipsec.proto | 1 + tests/e2e/070_ipsec_test.go | 11 +- 9 files changed, 95 insertions(+), 70 deletions(-) diff --git a/plugins/vpp/ipsecplugin/vppcalls/vpp1908/dump_vppcalls.go b/plugins/vpp/ipsecplugin/vppcalls/vpp1908/dump_vppcalls.go index 3860e9eb69..a9e62e3a7d 100644 --- a/plugins/vpp/ipsecplugin/vppcalls/vpp1908/dump_vppcalls.go +++ b/plugins/vpp/ipsecplugin/vppcalls/vpp1908/dump_vppcalls.go @@ -61,6 +61,7 @@ func (h *IPSecVppHandler) DumpIPSecSAWithIndex(saID uint32) (saList []*vppcalls. Protocol: ipsec.SecurityAssociation_IPSecProtocol(saData.Entry.Protocol), CryptoAlg: ipsec.CryptoAlg(saData.Entry.CryptoAlgorithm), CryptoKey: hex.EncodeToString(saData.Entry.CryptoKey.Data[:saData.Entry.CryptoKey.Length]), + CryptoSalt: saData.Entry.Salt, IntegAlg: ipsec.IntegAlg(saData.Entry.IntegrityAlgorithm), IntegKey: hex.EncodeToString(saData.Entry.IntegrityKey.Data[:saData.Entry.IntegrityKey.Length]), UseEsn: (saData.Entry.Flags & ipsecapi.IPSEC_API_SAD_FLAG_USE_ESN) != 0, diff --git a/plugins/vpp/ipsecplugin/vppcalls/vpp1908/ipsec_vppcalls.go b/plugins/vpp/ipsecplugin/vppcalls/vpp1908/ipsec_vppcalls.go index 6099a0e423..b69f4160c4 100644 --- a/plugins/vpp/ipsecplugin/vppcalls/vpp1908/ipsec_vppcalls.go +++ b/plugins/vpp/ipsecplugin/vppcalls/vpp1908/ipsec_vppcalls.go @@ -235,6 +235,7 @@ func (h *IPSecVppHandler) sadAddDelEntry(sa *ipsec.SecurityAssociation, isAdd bo Data: cryptoKey, Length: uint8(len(cryptoKey)), }, + Salt: sa.CryptoSalt, IntegrityAlgorithm: api.IpsecIntegAlg(sa.IntegAlg), IntegrityKey: api.Key{ Data: integKey, diff --git a/plugins/vpp/ipsecplugin/vppcalls/vpp2001/dump_vppcalls.go b/plugins/vpp/ipsecplugin/vppcalls/vpp2001/dump_vppcalls.go index cd9ba796e6..8f28a0b61a 100644 --- a/plugins/vpp/ipsecplugin/vppcalls/vpp2001/dump_vppcalls.go +++ b/plugins/vpp/ipsecplugin/vppcalls/vpp2001/dump_vppcalls.go @@ -62,6 +62,7 @@ func (h *IPSecVppHandler) DumpIPSecSAWithIndex(saID uint32) (saList []*vppcalls. Protocol: ipsec.SecurityAssociation_IPSecProtocol(saData.Entry.Protocol), CryptoAlg: ipsec.CryptoAlg(saData.Entry.CryptoAlgorithm), CryptoKey: hex.EncodeToString(saData.Entry.CryptoKey.Data[:saData.Entry.CryptoKey.Length]), + CryptoSalt: saData.Entry.Salt, IntegAlg: ipsec.IntegAlg(saData.Entry.IntegrityAlgorithm), IntegKey: hex.EncodeToString(saData.Entry.IntegrityKey.Data[:saData.Entry.IntegrityKey.Length]), UseEsn: (saData.Entry.Flags & ipsec_types.IPSEC_API_SAD_FLAG_USE_ESN) != 0, diff --git a/plugins/vpp/ipsecplugin/vppcalls/vpp2001/ipsec_vppcalls.go b/plugins/vpp/ipsecplugin/vppcalls/vpp2001/ipsec_vppcalls.go index b50f28d6c0..06a608ed84 100644 --- a/plugins/vpp/ipsecplugin/vppcalls/vpp2001/ipsec_vppcalls.go +++ b/plugins/vpp/ipsecplugin/vppcalls/vpp2001/ipsec_vppcalls.go @@ -235,6 +235,7 @@ func (h *IPSecVppHandler) sadAddDelEntry(sa *ipsec.SecurityAssociation, isAdd bo Data: cryptoKey, Length: uint8(len(cryptoKey)), }, + Salt: sa.CryptoSalt, IntegrityAlgorithm: vpp_ipsec.IpsecIntegAlg(sa.IntegAlg), IntegrityKey: vpp_ipsec.Key{ Data: integKey, diff --git a/plugins/vpp/ipsecplugin/vppcalls/vpp2005/dump_vppcalls.go b/plugins/vpp/ipsecplugin/vppcalls/vpp2005/dump_vppcalls.go index 5db967f64a..82bb706a17 100644 --- a/plugins/vpp/ipsecplugin/vppcalls/vpp2005/dump_vppcalls.go +++ b/plugins/vpp/ipsecplugin/vppcalls/vpp2005/dump_vppcalls.go @@ -61,11 +61,14 @@ func (h *IPSecVppHandler) DumpIPSecSAWithIndex(saID uint32) (saList []*vppcalls. Protocol: ipsecProtoToProtocol(saData.Entry.Protocol), CryptoAlg: ipsec.CryptoAlg(saData.Entry.CryptoAlgorithm), CryptoKey: hex.EncodeToString(saData.Entry.CryptoKey.Data[:saData.Entry.CryptoKey.Length]), + CryptoSalt: saData.Entry.Salt, IntegAlg: ipsec.IntegAlg(saData.Entry.IntegrityAlgorithm), IntegKey: hex.EncodeToString(saData.Entry.IntegrityKey.Data[:saData.Entry.IntegrityKey.Length]), UseEsn: (saData.Entry.Flags & ipsec_types.IPSEC_API_SAD_FLAG_USE_ESN) != 0, UseAntiReplay: (saData.Entry.Flags & ipsec_types.IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY) != 0, EnableUdpEncap: (saData.Entry.Flags & ipsec_types.IPSEC_API_SAD_FLAG_UDP_ENCAP) != 0, + TunnelSrcPort: uint32(saData.Entry.UDPSrcPort), + TunnelDstPort: uint32(saData.Entry.UDPDstPort), } if !tunnelSrcAddr.IsUnspecified() { sa.TunnelSrcAddr = tunnelSrcAddr.String() diff --git a/plugins/vpp/ipsecplugin/vppcalls/vpp2005/ipsec_vppcalls.go b/plugins/vpp/ipsecplugin/vppcalls/vpp2005/ipsec_vppcalls.go index 02ca4c5702..e0bc012315 100644 --- a/plugins/vpp/ipsecplugin/vppcalls/vpp2005/ipsec_vppcalls.go +++ b/plugins/vpp/ipsecplugin/vppcalls/vpp2005/ipsec_vppcalls.go @@ -245,6 +245,7 @@ func (h *IPSecVppHandler) sadAddDelEntry(sa *ipsec.SecurityAssociation, isAdd bo Data: cryptoKey, Length: uint8(len(cryptoKey)), }, + Salt: sa.CryptoSalt, IntegrityAlgorithm: vpp_ipsec.IpsecIntegAlg(sa.IntegAlg), IntegrityKey: vpp_ipsec.Key{ Data: integKey, diff --git a/proto/ligato/vpp/ipsec/ipsec.pb.go b/proto/ligato/vpp/ipsec/ipsec.pb.go index 76d2b2841a..3a8c57f66c 100644 --- a/proto/ligato/vpp/ipsec/ipsec.pb.go +++ b/proto/ligato/vpp/ipsec/ipsec.pb.go @@ -588,6 +588,7 @@ type SecurityAssociation struct { Protocol SecurityAssociation_IPSecProtocol `protobuf:"varint,3,opt,name=protocol,proto3,enum=ligato.vpp.ipsec.SecurityAssociation_IPSecProtocol" json:"protocol,omitempty"` CryptoAlg CryptoAlg `protobuf:"varint,4,opt,name=crypto_alg,json=cryptoAlg,proto3,enum=ligato.vpp.ipsec.CryptoAlg" json:"crypto_alg,omitempty"` CryptoKey string `protobuf:"bytes,5,opt,name=crypto_key,json=cryptoKey,proto3" json:"crypto_key,omitempty"` + CryptoSalt uint32 `protobuf:"varint,15,opt,name=crypto_salt,json=cryptoSalt,proto3" json:"crypto_salt,omitempty"` IntegAlg IntegAlg `protobuf:"varint,6,opt,name=integ_alg,json=integAlg,proto3,enum=ligato.vpp.ipsec.IntegAlg" json:"integ_alg,omitempty"` IntegKey string `protobuf:"bytes,7,opt,name=integ_key,json=integKey,proto3" json:"integ_key,omitempty"` UseEsn bool `protobuf:"varint,8,opt,name=use_esn,json=useEsn,proto3" json:"use_esn,omitempty"` @@ -662,6 +663,13 @@ func (m *SecurityAssociation) GetCryptoKey() string { return "" } +func (m *SecurityAssociation) GetCryptoSalt() uint32 { + if m != nil { + return m.CryptoSalt + } + return 0 +} + func (m *SecurityAssociation) GetIntegAlg() IntegAlg { if m != nil { return m.IntegAlg @@ -813,72 +821,73 @@ func init() { } var fileDescriptor_3aa20672189bf205 = []byte{ - // 1067 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xdf, 0x6e, 0xdb, 0x36, - 0x14, 0xc6, 0xe3, 0x7f, 0xb2, 0x7c, 0x1c, 0x39, 0x1a, 0xbb, 0x3f, 0x5a, 0xda, 0xa1, 0x86, 0x2f, - 0x36, 0x23, 0xc0, 0x1c, 0xc4, 0x69, 0xba, 0xa6, 0x19, 0x30, 0x38, 0xb6, 0xd1, 0x04, 0x5b, 0x63, - 0x43, 0xf2, 0x06, 0x74, 0x37, 0x82, 0x22, 0x71, 0x9e, 0x30, 0x57, 0x24, 0x44, 0x3a, 0xa8, 0xef, - 0xf6, 0x88, 0x7b, 0x87, 0xdd, 0x0d, 0x03, 0xf6, 0x0a, 0x03, 0x0f, 0x65, 0x45, 0x4e, 0xd3, 0xd5, - 0x18, 0x7a, 0x63, 0xe8, 0x7c, 0xfc, 0xf8, 0x51, 0x47, 0xfe, 0x89, 0x14, 0x3c, 0x5a, 0xc4, 0xf3, - 0x40, 0xb2, 0xc3, 0x1b, 0xce, 0x0f, 0x63, 0x2e, 0x68, 0xa8, 0x7f, 0x7b, 0x3c, 0x65, 0x92, 0x11, - 0x5b, 0x8f, 0xf6, 0x6e, 0x38, 0xef, 0xa1, 0xde, 0xf9, 0xcb, 0x80, 0x4f, 0x3d, 0x1a, 0x2e, 0xd3, - 0x58, 0xae, 0xa6, 0x6c, 0x11, 0x87, 0xab, 0x51, 0x20, 0x83, 0xeb, 0x40, 0x50, 0xf2, 0x31, 0xd4, - 0xe2, 0x24, 0xa2, 0x6f, 0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 0xb0, 0x30, 0x58, 0x14, 0x43, 0x0d, 0xed, - 0x44, 0xfd, 0x36, 0xf3, 0x4b, 0xd8, 0xdb, 0x70, 0x32, 0xee, 0xd4, 0xd1, 0x68, 0x15, 0x8c, 0x8c, - 0xeb, 0x26, 0x99, 0x64, 0x21, 0x5b, 0x38, 0x26, 0xf6, 0x9f, 0xd7, 0x85, 0x1e, 0x38, 0x4b, 0x65, - 0xb6, 0x5c, 0x03, 0x4d, 0x59, 0x0f, 0x53, 0x96, 0xca, 0xbb, 0x3d, 0x64, 0x5e, 0xc6, 0x1d, 0x40, - 0x6b, 0xab, 0x68, 0x2d, 0xf6, 0x50, 0x08, 0x6d, 0x6a, 0x27, 0xea, 0xb7, 0x99, 0x79, 0x0f, 0xb7, - 0x91, 0xbb, 0x68, 0xb4, 0x0a, 0x46, 0xc6, 0x89, 0x07, 0x46, 0x10, 0xca, 0x98, 0x25, 0x8e, 0xd5, - 0x2e, 0x75, 0x5b, 0xfd, 0xb3, 0xff, 0x43, 0x53, 0x6f, 0x80, 0x11, 0x6e, 0x16, 0xd5, 0x39, 0x03, - 0x43, 0x2b, 0x04, 0xc0, 0x38, 0x7f, 0x35, 0x1d, 0x78, 0x9e, 0xbd, 0x43, 0x9a, 0x50, 0x1f, 0x5d, - 0x7a, 0xc3, 0x81, 0x3b, 0xb2, 0x4b, 0xaa, 0x70, 0xc7, 0xde, 0xe4, 0x87, 0x9f, 0xc6, 0x76, 0x59, - 0x15, 0x53, 0x77, 0x32, 0x1b, 0x0f, 0x67, 0x76, 0xa5, 0xf3, 0x4f, 0x15, 0x5a, 0x9b, 0x4b, 0x92, - 0x87, 0xd0, 0x10, 0x3c, 0xda, 0x20, 0xcd, 0x14, 0x3c, 0xd2, 0xa8, 0x15, 0x29, 0x2c, 0xbf, 0x9b, - 0xc2, 0xca, 0x7f, 0x53, 0x58, 0xdd, 0x8e, 0xc2, 0xda, 0xf6, 0x14, 0x1a, 0x5b, 0x53, 0x58, 0xdf, - 0x96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 0x00, 0xff, 0xff, 0x21, 0x27, 0xbb, 0xe8, 0x92, 0x0a, 0x00, 0x00, + // 1085 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcf, 0x6e, 0xdb, 0xc6, + 0x13, 0xc7, 0xad, 0x7f, 0x14, 0x35, 0x0a, 0x65, 0xfe, 0x36, 0xbf, 0xb6, 0xac, 0x93, 0x22, 0x82, + 0x0e, 0xad, 0x10, 0xa0, 0x32, 0x22, 0xc7, 0x69, 0x1c, 0x17, 0x28, 0x64, 0x49, 0x88, 0x8d, 0x36, + 0x96, 0x40, 0xaa, 0x05, 0xd2, 0x0b, 0xb1, 0xa6, 0xb6, 0x2a, 0x51, 0x86, 0xbb, 0xe0, 0xae, 0x8c, + 0xe8, 0xd6, 0x17, 0xe8, 0xbb, 0xf5, 0x1d, 0x7a, 0xeb, 0xa5, 0xaf, 0x50, 0xec, 0x2c, 0x25, 0x53, + 0x8e, 0xd3, 0x08, 0x45, 0x2f, 0x02, 0xe7, 0xbb, 0xdf, 0x99, 0xe1, 0x50, 0x9f, 0x5d, 0x12, 0x1e, + 0x26, 0xf1, 0x82, 0x2a, 0x7e, 0x78, 0x2d, 0xc4, 0x61, 0x2c, 0x24, 0x8b, 0xcc, 0x6f, 0x4f, 0x64, + 0x5c, 0x71, 0xe2, 0x9a, 0xd5, 0xde, 0xb5, 0x10, 0x3d, 0xd4, 0x3b, 0x7f, 0x5a, 0xf0, 0x71, 0xc0, + 0xa2, 0x65, 0x16, 0xab, 0xd5, 0x94, 0x27, 0x71, 0xb4, 0x1a, 0x51, 0x45, 0xaf, 0xa8, 0x64, 0xe4, + 0xff, 0x50, 0x8b, 0xd3, 0x39, 0x7b, 0xeb, 0x95, 0xda, 0xa5, 0xae, 0xe3, 0x9b, 0x80, 0xf8, 0x00, + 0x71, 0xaa, 0x58, 0xf6, 0x13, 0x8d, 0x98, 0xf4, 0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 0xee, 0xf4, 0x18, 0xc3, 0xb3, 0x0a, 0x00, 0x00, } diff --git a/proto/ligato/vpp/ipsec/ipsec.proto b/proto/ligato/vpp/ipsec/ipsec.proto index 6cbaded201..de2e2c61b5 100644 --- a/proto/ligato/vpp/ipsec/ipsec.proto +++ b/proto/ligato/vpp/ipsec/ipsec.proto @@ -113,6 +113,7 @@ message SecurityAssociation { CryptoAlg crypto_alg = 4; /* Cryptographic algorithm for encryption */ string crypto_key = 5; + uint32 crypto_salt = 15; IntegAlg integ_alg = 6; /* Cryptographic algorithm for authentication */ string integ_key = 7; diff --git a/tests/e2e/070_ipsec_test.go b/tests/e2e/070_ipsec_test.go index b169989c69..c169906bb0 100644 --- a/tests/e2e/070_ipsec_test.go +++ b/tests/e2e/070_ipsec_test.go @@ -56,21 +56,28 @@ func TestIPSec(t *testing.T) { Index: 10, Spi: 123, Protocol: vpp_ipsec.SecurityAssociation_ESP, - CryptoAlg: vpp_ipsec.CryptoAlg_AES_CBC_128, + CryptoAlg: vpp_ipsec.CryptoAlg_AES_GCM_128, CryptoKey: "d9a4ec50aed76f1bf80bc915d8fcfe1c", + CryptoSalt: 1500, IntegAlg: vpp_ipsec.IntegAlg_SHA1_96, IntegKey: "bf9b150aaf5c2a87d79898b11eabd055e70abdbe", EnableUdpEncap: true, + TunnelSrcPort: 4500, + TunnelDstPort: 8777, + } saIn := &vpp_ipsec.SecurityAssociation{ Index: 20, Spi: 456, Protocol: vpp_ipsec.SecurityAssociation_ESP, - CryptoAlg: vpp_ipsec.CryptoAlg_AES_CBC_128, + CryptoAlg: vpp_ipsec.CryptoAlg_AES_GCM_128, CryptoKey: "d9a4ec50aed76f1bf80bc915d8fcfe1c", + CryptoSalt: 8900, IntegAlg: vpp_ipsec.IntegAlg_SHA1_96, IntegKey: "bf9b150aaf5c2a87d79898b11eabd055e70abdbe", EnableUdpEncap: true, + TunnelSrcPort: 8777, + TunnelDstPort: 4500, } spOut := &vpp_ipsec.SecurityPolicy{ SpdIndex: 100,