@@ -44,7 +44,7 @@ func TestServerDBCrypt(t *testing.T) {
44
44
db := database .New (sqlDB )
45
45
46
46
// Populate the database with some unencrypted data.
47
- t .Logf ("Generating unencrypted data" )
47
+ t .Log ("Generating unencrypted data" )
48
48
users := genData (t , db )
49
49
50
50
// Setup an initial cipher A
@@ -57,7 +57,7 @@ func TestServerDBCrypt(t *testing.T) {
57
57
require .NoError (t , err )
58
58
59
59
// Populate the database with some encrypted data using cipher A.
60
- t .Logf ("Generating data encrypted with cipher A" )
60
+ t .Log ("Generating data encrypted with cipher A" )
61
61
newUsers := genData (t , cryptdb )
62
62
63
63
// Validate that newly created users were encrypted with cipher A
@@ -67,7 +67,7 @@ func TestServerDBCrypt(t *testing.T) {
67
67
users = append (users , newUsers ... )
68
68
69
69
// Encrypt all the data with the initial cipher.
70
- t .Logf ("Encrypting all data with cipher A" )
70
+ t .Log ("Encrypting all data with cipher A" )
71
71
inv , _ := newCLI (t , "server" , "dbcrypt" , "rotate" ,
72
72
"--postgres-url" , connectionURL ,
73
73
"--new-key" , base64 .StdEncoding .EncodeToString ([]byte (keyA )),
@@ -89,7 +89,7 @@ func TestServerDBCrypt(t *testing.T) {
89
89
cipherBA , err := dbcrypt .NewCiphers ([]byte (keyB ), []byte (keyA ))
90
90
require .NoError (t , err )
91
91
92
- t .Logf ("Enrypting all data with cipher B" )
92
+ t .Log ("Enrypting all data with cipher B" )
93
93
inv , _ = newCLI (t , "server" , "dbcrypt" , "rotate" ,
94
94
"--postgres-url" , connectionURL ,
95
95
"--new-key" , base64 .StdEncoding .EncodeToString ([]byte (keyB )),
@@ -108,7 +108,7 @@ func TestServerDBCrypt(t *testing.T) {
108
108
}
109
109
110
110
// Assert that we can revoke the old key.
111
- t .Logf ("Revoking cipher A" )
111
+ t .Log ("Revoking cipher A" )
112
112
err = db .RevokeDBCryptKey (ctx , cipherA [0 ].HexDigest ())
113
113
require .NoError (t , err , "failed to revoke old key" )
114
114
@@ -124,15 +124,15 @@ func TestServerDBCrypt(t *testing.T) {
124
124
require .Empty (t , oldKey .ActiveKeyDigest .String , "expected the old key to not be active" )
125
125
126
126
// Revoking the new key should fail.
127
- t .Logf ("Attempting to revoke cipher B should fail as it is still in use" )
127
+ t .Log ("Attempting to revoke cipher B should fail as it is still in use" )
128
128
err = db .RevokeDBCryptKey (ctx , cipherBA [0 ].HexDigest ())
129
129
require .Error (t , err , "expected to fail to revoke the new key" )
130
130
var pgErr * pq.Error
131
131
require .True (t , xerrors .As (err , & pgErr ), "expected a pg error" )
132
132
require .EqualValues (t , "23503" , pgErr .Code , "expected a foreign key constraint violation error" )
133
133
134
134
// Decrypt the data using only cipher B. This should result in the key being revoked.
135
- t .Logf ("Decrypting with cipher B" )
135
+ t .Log ("Decrypting with cipher B" )
136
136
inv , _ = newCLI (t , "server" , "dbcrypt" , "decrypt" ,
137
137
"--postgres-url" , connectionURL ,
138
138
"--keys" , base64 .StdEncoding .EncodeToString ([]byte (keyB )),
@@ -162,7 +162,7 @@ func TestServerDBCrypt(t *testing.T) {
162
162
cipherC , err := dbcrypt .NewCiphers ([]byte (keyC ))
163
163
require .NoError (t , err )
164
164
165
- t .Logf ("Re-encrypting with cipher C" )
165
+ t .Log ("Re-encrypting with cipher C" )
166
166
inv , _ = newCLI (t , "server" , "dbcrypt" , "rotate" ,
167
167
"--postgres-url" , connectionURL ,
168
168
"--new-key" , base64 .StdEncoding .EncodeToString ([]byte (keyC )),
@@ -181,7 +181,7 @@ func TestServerDBCrypt(t *testing.T) {
181
181
}
182
182
183
183
// Now delete all the encrypted data.
184
- t .Logf ("Deleting all encrypted data" )
184
+ t .Log ("Deleting all encrypted data" )
185
185
inv , _ = newCLI (t , "server" , "dbcrypt" , "delete" ,
186
186
"--postgres-url" , connectionURL ,
187
187
"--external-token-encryption-keys" , base64 .StdEncoding .EncodeToString ([]byte (keyC )),
0 commit comments