diff --git a/modules/saml/www/sp/saml2-logout.php b/modules/saml/www/sp/saml2-logout.php
index 40197282cec4cec1a7ad53ad7c5108ef6f57d3be..0df055c1845e4ea2cbce734af72c4f7e29235fd8 100644
--- a/modules/saml/www/sp/saml2-logout.php
+++ b/modules/saml/www/sp/saml2-logout.php
@@ -72,9 +72,8 @@ if ($message instanceof SAML2_LogoutResponse) {
 		$lastException = NULL;
 		foreach ($keys as $i => $key) {
 			try {
-				$ret = $assertion->getAssertion($key);
+				$message->decryptNameId($key);
 				SimpleSAML_Logger::debug('Decryption with key #' . $i . ' succeeded.');
-				return $ret;
 			} catch (Exception $e) {
 				SimpleSAML_Logger::debug('Decryption with key #' . $i . ' failed with exception: ' . $e->getMessage());
 				$lastException = $e;