diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-04-24 07:57:49 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-05-05 19:24:11 -0400 |
commit | 26efa0bac9dc3587ee8892c06642735bcded59e5 (patch) | |
tree | 2d6d75ffa9671b972cadcbc62ed365e992ea247a /fs/cifs/asn1.c | |
parent | 198b5682781b97251afd9025dbf559a77969abdd (diff) |
cifs: have decode_negTokenInit set flags in server struct
...rather than the secType. This allows us to get rid of the MSKerberos
securityEnum. The client just makes a decision at upcall time.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/asn1.c')
-rw-r--r-- | fs/cifs/asn1.c | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/fs/cifs/asn1.c b/fs/cifs/asn1.c index 6d555c05dba9..cfd1ce34e0bc 100644 --- a/fs/cifs/asn1.c +++ b/fs/cifs/asn1.c | |||
@@ -492,17 +492,13 @@ compare_oid(unsigned long *oid1, unsigned int oid1len, | |||
492 | 492 | ||
493 | int | 493 | int |
494 | decode_negTokenInit(unsigned char *security_blob, int length, | 494 | decode_negTokenInit(unsigned char *security_blob, int length, |
495 | enum securityEnum *secType) | 495 | struct TCP_Server_Info *server) |
496 | { | 496 | { |
497 | struct asn1_ctx ctx; | 497 | struct asn1_ctx ctx; |
498 | unsigned char *end; | 498 | unsigned char *end; |
499 | unsigned char *sequence_end; | 499 | unsigned char *sequence_end; |
500 | unsigned long *oid = NULL; | 500 | unsigned long *oid = NULL; |
501 | unsigned int cls, con, tag, oidlen, rc; | 501 | unsigned int cls, con, tag, oidlen, rc; |
502 | bool use_ntlmssp = false; | ||
503 | bool use_kerberos = false; | ||
504 | bool use_kerberosu2u = false; | ||
505 | bool use_mskerberos = false; | ||
506 | 502 | ||
507 | /* cifs_dump_mem(" Received SecBlob ", security_blob, length); */ | 503 | /* cifs_dump_mem(" Received SecBlob ", security_blob, length); */ |
508 | 504 | ||
@@ -599,20 +595,17 @@ decode_negTokenInit(unsigned char *security_blob, int length, | |||
599 | *(oid + 1), *(oid + 2), *(oid + 3)); | 595 | *(oid + 1), *(oid + 2), *(oid + 3)); |
600 | 596 | ||
601 | if (compare_oid(oid, oidlen, MSKRB5_OID, | 597 | if (compare_oid(oid, oidlen, MSKRB5_OID, |
602 | MSKRB5_OID_LEN) && | 598 | MSKRB5_OID_LEN)) |
603 | !use_mskerberos) | 599 | server->sec_mskerberos = true; |
604 | use_mskerberos = true; | ||
605 | else if (compare_oid(oid, oidlen, KRB5U2U_OID, | 600 | else if (compare_oid(oid, oidlen, KRB5U2U_OID, |
606 | KRB5U2U_OID_LEN) && | 601 | KRB5U2U_OID_LEN)) |
607 | !use_kerberosu2u) | 602 | server->sec_kerberosu2u = true; |
608 | use_kerberosu2u = true; | ||
609 | else if (compare_oid(oid, oidlen, KRB5_OID, | 603 | else if (compare_oid(oid, oidlen, KRB5_OID, |
610 | KRB5_OID_LEN) && | 604 | KRB5_OID_LEN)) |
611 | !use_kerberos) | 605 | server->sec_kerberos = true; |
612 | use_kerberos = true; | ||
613 | else if (compare_oid(oid, oidlen, NTLMSSP_OID, | 606 | else if (compare_oid(oid, oidlen, NTLMSSP_OID, |
614 | NTLMSSP_OID_LEN)) | 607 | NTLMSSP_OID_LEN)) |
615 | use_ntlmssp = true; | 608 | server->sec_ntlmssp = true; |
616 | 609 | ||
617 | kfree(oid); | 610 | kfree(oid); |
618 | } | 611 | } |
@@ -669,12 +662,5 @@ decode_negTokenInit(unsigned char *security_blob, int length, | |||
669 | cFYI(1, "Need to call asn1_octets_decode() function for %s", | 662 | cFYI(1, "Need to call asn1_octets_decode() function for %s", |
670 | ctx.pointer); /* is this UTF-8 or ASCII? */ | 663 | ctx.pointer); /* is this UTF-8 or ASCII? */ |
671 | decode_negtoken_exit: | 664 | decode_negtoken_exit: |
672 | if (use_kerberos) | ||
673 | *secType = Kerberos; | ||
674 | else if (use_mskerberos) | ||
675 | *secType = MSKerberos; | ||
676 | else if (use_ntlmssp) | ||
677 | *secType = RawNTLMSSP; | ||
678 | |||
679 | return 1; | 665 | return 1; |
680 | } | 666 | } |