From d58ae8ead95c283ad78d64195978ba92883d345d Mon Sep 17 00:00:00 2001 From: Matt Primrose Date: Thu, 17 Oct 2024 15:29:29 -0700 Subject: [PATCH] fix: update ieee8021x config struct to be a pointer --- pkg/config/v2.go | 32 +++++++++++------------ pkg/security/decrypt_test.go | 3 ++- pkg/security/testing/encryptedConfig.yaml | 2 +- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/pkg/config/v2.go b/pkg/config/v2.go index 9e67798e..2f51fafa 100644 --- a/pkg/config/v2.go +++ b/pkg/config/v2.go @@ -31,16 +31,16 @@ type Network struct { } type Wired struct { - DHCPEnabled bool `yaml:"dhcpEnabled"` - IPSyncEnabled bool `yaml:"ipSyncEnabled"` - SharedStaticIP bool `yaml:"sharedStaticIP"` - IPAddress string `yaml:"ipAddress"` - SubnetMask string `yaml:"subnetMask"` - DefaultGateway string `yaml:"defaultGateway"` - PrimaryDNS string `yaml:"primaryDNS"` - SecondaryDNS string `yaml:"secondaryDNS"` - Authentication string `yaml:"authentication"` - IEEE8021x IEEE8021x `yaml:"ieee8021x"` + DHCPEnabled bool `yaml:"dhcpEnabled"` + IPSyncEnabled bool `yaml:"ipSyncEnabled"` + SharedStaticIP bool `yaml:"sharedStaticIP"` + IPAddress string `yaml:"ipAddress"` + SubnetMask string `yaml:"subnetMask"` + DefaultGateway string `yaml:"defaultGateway"` + PrimaryDNS string `yaml:"primaryDNS"` + SecondaryDNS string `yaml:"secondaryDNS"` + Authentication string `yaml:"authentication"` + IEEE8021x *IEEE8021x `yaml:"ieee8021x"` } type Wireless struct { @@ -48,12 +48,12 @@ type Wireless struct { } type WirelessProfile struct { - SSID string `yaml:"ssid"` - Password string `yaml:"password"` - AuthenticationMethod string `yaml:"authenticationMethod"` - EncryptionMethod string `yaml:"encryptionMethod"` - Priority int `yaml:"priority"` - IEEE8021x IEEE8021x `yaml:"ieee8021x"` + SSID string `yaml:"ssid"` + Password string `yaml:"password"` + AuthenticationMethod string `yaml:"authenticationMethod"` + EncryptionMethod string `yaml:"encryptionMethod"` + Priority int `yaml:"priority"` + IEEE8021x *IEEE8021x `yaml:"ieee8021x"` } type IEEE8021x struct { diff --git a/pkg/security/decrypt_test.go b/pkg/security/decrypt_test.go index f20ee7b3..453cd50b 100644 --- a/pkg/security/decrypt_test.go +++ b/pkg/security/decrypt_test.go @@ -50,7 +50,7 @@ var ( AuthenticationMethod: "WPA3 SAE", EncryptionMethod: "CCMP", Priority: 1, - IEEE8021x: config.IEEE8021x{ + IEEE8021x: &config.IEEE8021x{ AuthenticationProtocol: 0, Username: "", Password: "", @@ -229,6 +229,7 @@ func TestReadAndDecryptFile(t *testing.T) { cryptor := Crypto{ EncryptionKey: test.key, } + _, err := cryptor.ReadAndDecryptFile(test.filePath) if !test.expectedError.InvalidKeySizeError && !test.expectedError.AuthenticationError && !test.expectedError.NewCipherError && !test.expectedError.Base64Error && !test.expectedError.FileReadError { diff --git a/pkg/security/testing/encryptedConfig.yaml b/pkg/security/testing/encryptedConfig.yaml index 12d36c02..1f75a6fd 100644 --- a/pkg/security/testing/encryptedConfig.yaml +++ b/pkg/security/testing/encryptedConfig.yaml @@ -1 +1 @@ -bwt4bpq8STTYnMagG6xYtW/HUTSlBk08WMX4YvxhiPqHuPi2hAkIm+bZkxyYA3l0MAEVpXco/qBRNSDBBJVeWocqzQtOkikcyNIcIVncDy1wuglwlReSjo96P18412PWC3hvdj9ckufTCiZkQt279cDXbgaVVO05PhdLRqiEXwPdiiFZIpPqhUpPpDNBDSEDTs+o20zGosr0ju8awc0HSHTf7k9IoqvD1tKlOl8oKqQMmMpJOmuWHDCqflutb1e1R22kau83oLgvCR3sVG+VznoPMNrcl/BUGwQr0SFkEFTNaVqKjI7K7NRRRdZNOncDALIVu8nfEqIcnqI/Nu8nZg3lxX+klC0eVS3rJb3AF0sdpg4EMAQqkKFC+ULPAbQ6PuwJk4Mds+tTc7bjanR/QSZCx4EzcD40DmVwyaUO0g+qAuLLjDBPVW5trgZ5xKdaeBeOqCZnQNu2+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