Fixing rsa hardware crypto service nil-interface bug

Signed-off-by: Diogo Monica <diogo@docker.com>
This commit is contained in:
Diogo Monica 2015-07-22 17:17:02 -07:00
parent be1d365626
commit a2a0385c53
1 changed files with 5 additions and 1 deletions

View File

@ -113,7 +113,11 @@ func (s *RSAHardwareCryptoService) RemoveKey(keyID string) error {
// GetKey returns the public components of a particular key
func (s *RSAHardwareCryptoService) GetKey(keyID string) data.PublicKey {
return s.keys[keyID]
key, ok := s.keys[keyID]
if !ok {
return nil
}
return key
}
// Sign returns a signature for a given signature request