Skip to content

Commit

Permalink
Add fips check when checking for root key encryption
Browse files Browse the repository at this point in the history
Signed-off-by: Umayr Shahid <[email protected]>
  • Loading branch information
umayr committed Apr 6, 2017
1 parent dc84eaa commit e877c7f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cryptoservice/crypto_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ func CheckRootKeyIsEncrypted(pemBytes []byte) error {
return ErrNoValidPrivateKey
}

if notary.FIPSEnabled {
if block.Type == "PRIVATE ENCRYPTED KEY" {
return nil
}
return ErrRootKeyNotEncrypted
}

if !x509.IsEncryptedPEMBlock(block) {
return ErrRootKeyNotEncrypted
}
Expand Down

0 comments on commit e877c7f

Please sign in to comment.