diff options
author | Steve French <sfrench@us.ibm.com> | 2008-08-25 20:37:14 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2008-08-25 20:37:14 -0400 |
commit | 6ce5eecb9cd3ac97b952c50309b87c31488a45e9 (patch) | |
tree | 5d28ff051283462f6c927ae87c094b568fb5b1e9 /fs/cifs/sess.c | |
parent | 3d2af3465e91335bd1dbf36b19e92079d901409f (diff) |
[CIFS] check version in spnego upcall response
Currently, we don't check the version in the SPNEGO upcall response
even though one is provided. Jeff and Q have made the corresponding
change to the Samba client (cifs.upcall).
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/sess.c')
-rw-r--r-- | fs/cifs/sess.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 3188e4d9cddb..b537fad3bf50 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c | |||
@@ -516,6 +516,15 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time, | |||
516 | } | 516 | } |
517 | 517 | ||
518 | msg = spnego_key->payload.data; | 518 | msg = spnego_key->payload.data; |
519 | /* check version field to make sure that cifs.upcall is | ||
520 | sending us a response in an expected form */ | ||
521 | if (msg->version != CIFS_SPNEGO_UPCALL_VERSION) { | ||
522 | cERROR(1, ("incorrect version of cifs.upcall (expected" | ||
523 | " %d but got %d)", | ||
524 | CIFS_SPNEGO_UPCALL_VERSION, msg->version)); | ||
525 | rc = -EKEYREJECTED; | ||
526 | goto ssetup_exit; | ||
527 | } | ||
519 | /* bail out if key is too long */ | 528 | /* bail out if key is too long */ |
520 | if (msg->sesskey_len > | 529 | if (msg->sesskey_len > |
521 | sizeof(ses->server->mac_signing_key.data.krb5)) { | 530 | sizeof(ses->server->mac_signing_key.data.krb5)) { |