Skip to content

Commit

Permalink
Removed deferred call to Wipe on decoding creds. The client is respon…
Browse files Browse the repository at this point in the history
…sible to

call wipe after the contents are processed.
  • Loading branch information
aricart committed Jul 30, 2019
1 parent 829b612 commit e93faba
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions creds_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ func FormatUserConfig(jwtString string, seed []byte) ([]byte, error) {
}

func ParseDecoratedJWT(contents []byte) (string, error) {
defer wipeSlice(contents)

items := userConfigRE.FindAllSubmatch(contents, -1)
if len(items) == 0 {
return string(contents), nil
Expand All @@ -138,7 +136,6 @@ func ParseDecoratedJWT(contents []byte) (string, error) {

func ParseDecoratedNKey(contents []byte) (nkeys.KeyPair, error) {
var seed []byte
defer wipeSlice(contents)

items := userConfigRE.FindAllSubmatch(contents, -1)
if len(items) > 1 {
Expand Down Expand Up @@ -187,10 +184,3 @@ func ParseDecoratedUserNKey(contents []byte) (nkeys.KeyPair, error) {
}
return kp, nil
}

// Just wipe slice with 'x', for clearing contents of nkey seed file.
func wipeSlice(buf []byte) {
for i := range buf {
buf[i] = 'x'
}
}

0 comments on commit e93faba

Please sign in to comment.