diff --git a/modules/saml/lib/Message.php b/modules/saml/lib/Message.php
index 5552ce09b11e0528a2ee030b800e73f900b10124..6be055d218e621c498ab0ac6640891913fcd3ec6 100644
--- a/modules/saml/lib/Message.php
+++ b/modules/saml/lib/Message.php
@@ -630,7 +630,7 @@ class sspmod_saml_Message {
 		/* Decrypt the NameID element if it is encrypted. */
 		if ($assertion->isNameIdEncrypted()) {
 			try {
-				$key = self::getDecryptionKeys($idpMetadata, $spMetadata);
+				$keys = self::getDecryptionKeys($idpMetadata, $spMetadata);
 			} catch (Exception $e) {
 				throw new SimpleSAML_Error_Exception('Error decrypting NameID: ' . $e->getMessage());
 			}