Skip to content

Commit b22d485

Browse files
author
Keith Ball
committed
fixed failing pgp test
1 parent 6202895 commit b22d485

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

crypto/pgp_test.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ var publicPath = filepath.Join(os.TempDir(), "blocker", "public.pem")
2222
// Path to the private key
2323
var privatePath = filepath.Join(os.TempDir(), "blocker", "private.pem")
2424

25+
var cryptoProvider CryptoProvider
26+
2527
func SetupPGPTests() {
2628
depositoryDir := filepath.Join(os.TempDir(), "blocker")
2729

@@ -36,7 +38,7 @@ func SetupPGPTests() {
3638
os.Setenv("BLOCKER_PGP_PRIVATEKEY", privatePath)
3739

3840
// Get the keys
39-
GetPGPKeyRings()
41+
cryptoProvider, err = NewOpenPGPCryptoProvider()
4042
}
4143

4244
// Setup the REST testing suite
@@ -63,7 +65,7 @@ func (s *CryptoPGPSuite) TestPGPCrypto(c *C) {
6365

6466
fmt.Println("bytes to encrypt: " + string(bytesToEncrypt))
6567

66-
encryptedBytes, err := PGPEncrypt(bytesToEncrypt)
68+
encryptedBytes, err := cryptoProvider.Encrypt(bytesToEncrypt)
6769

6870
if err != nil {
6971
fmt.Println("Got error: " + err.Error())
@@ -74,7 +76,7 @@ func (s *CryptoPGPSuite) TestPGPCrypto(c *C) {
7476

7577
fmt.Println("encrypted bytes: " + string(encryptedBytes))
7678

77-
unencryptedBytes, err := PGPDecrypt(encryptedBytes)
79+
unencryptedBytes, err := cryptoProvider.Decrypt(encryptedBytes)
7880

7981
if err != nil {
8082
fmt.Println("Got error: " + err.Error())

0 commit comments

Comments
 (0)