diff --git a/Projs/PD1/internal/utils/cryptoUtils/cryptoUtils.go b/Projs/PD1/internal/utils/cryptoUtils/cryptoUtils.go index 393d3c4..7c4da1f 100644 --- a/Projs/PD1/internal/utils/cryptoUtils/cryptoUtils.go +++ b/Projs/PD1/internal/utils/cryptoUtils/cryptoUtils.go @@ -50,12 +50,12 @@ func LoadKeyStore(keyStorePath string, password string) KeyStore { var privKey *rsa.PrivateKey - certFile, err := os.ReadFile(keyStorePath) + keystoreBytes, err := os.ReadFile(keyStorePath) if err != nil { - log.Panicln("Provided certificate couldn't be opened") + log.Panicln("Provided keystorePath couldn't be opened") } - privKeyInterface, cert, caCerts, err := pkcs12.DecodeChain(certFile, password) + privKeyInterface, cert, caCerts, err := pkcs12.DecodeChain(keystoreBytes, password) if err != nil { log.Panicln("PKCS12 key store couldn't be decoded") } @@ -94,7 +94,7 @@ func (k *KeyStore) GetServerTLSConfig() *tls.Config { caCertPool.AddCert(caCert) } tlsConfig.ClientCAs = caCertPool - //FIX: SERVER ACCEPTS CONNECTIONS WITH UNMATCHING OR + //FIX: SERVER ACCEPTS CONNECTIONS WITH UNMATCHING OR // NO CERTIFICATE, NEEDS TO BE CHANGED SOMEHOW tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert return tlsConfig