|
@@ -335,9 +335,31 @@ generate_smb3signingkey(struct cifs_ses *ses,
|
|
|
if (rc)
|
|
|
return rc;
|
|
|
|
|
|
- return generate_key(ses, ptriplet->decryption.label,
|
|
|
- ptriplet->decryption.context,
|
|
|
- ses->smb3decryptionkey, SMB3_SIGN_KEY_SIZE);
|
|
|
+ rc = generate_key(ses, ptriplet->decryption.label,
|
|
|
+ ptriplet->decryption.context,
|
|
|
+ ses->smb3decryptionkey, SMB3_SIGN_KEY_SIZE);
|
|
|
+
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+#ifdef CONFIG_CIFS_DEBUG_DUMP_KEYS
|
|
|
+ cifs_dbg(VFS, "%s: dumping generated AES session keys\n", __func__);
|
|
|
+ /*
|
|
|
+ * The session id is opaque in terms of endianness, so we can't
|
|
|
+ * print it as a long long. we dump it as we got it on the wire
|
|
|
+ */
|
|
|
+ cifs_dbg(VFS, "Session Id %*ph\n", (int)sizeof(ses->Suid),
|
|
|
+ &ses->Suid);
|
|
|
+ cifs_dbg(VFS, "Session Key %*ph\n",
|
|
|
+ SMB2_NTLMV2_SESSKEY_SIZE, ses->auth_key.response);
|
|
|
+ cifs_dbg(VFS, "Signing Key %*ph\n",
|
|
|
+ SMB3_SIGN_KEY_SIZE, ses->smb3signingkey);
|
|
|
+ cifs_dbg(VFS, "ServerIn Key %*ph\n",
|
|
|
+ SMB3_SIGN_KEY_SIZE, ses->smb3encryptionkey);
|
|
|
+ cifs_dbg(VFS, "ServerOut Key %*ph\n",
|
|
|
+ SMB3_SIGN_KEY_SIZE, ses->smb3decryptionkey);
|
|
|
+#endif
|
|
|
+ return rc;
|
|
|
}
|
|
|
|
|
|
int
|