From a2a0385c53c4c1a35255083beb66df5c7662feb7 Mon Sep 17 00:00:00 2001 From: Diogo Monica Date: Wed, 22 Jul 2015 17:17:02 -0700 Subject: [PATCH] Fixing rsa hardware crypto service nil-interface bug Signed-off-by: Diogo Monica --- signer/api/rsa_hardware_crypto_service.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/signer/api/rsa_hardware_crypto_service.go b/signer/api/rsa_hardware_crypto_service.go index c0355ae0b5..177695b63e 100644 --- a/signer/api/rsa_hardware_crypto_service.go +++ b/signer/api/rsa_hardware_crypto_service.go @@ -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