From d726eb216ad431d2bbd4ee07f4098b72446cdca2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 12 Oct 2001 04:54:53 +0000 Subject: moved some OIDs to the ASN.1 header (This used to be commit 7092beef9d7a68018ede569883b22c822300c7ff) --- source3/include/asn1.h | 6 ++++++ source3/libsmb/cliconnect.c | 4 ++-- source3/libsmb/clispnego.c | 8 ++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/source3/include/asn1.h b/source3/include/asn1.h index 8d9bb158c8..ff415ebea7 100644 --- a/source3/include/asn1.h +++ b/source3/include/asn1.h @@ -45,3 +45,9 @@ typedef struct { #define ASN1_ENUMERATED 0xa #define ASN1_MAX_OIDS 20 + +/* some well known object IDs */ +#define OID_SPNEGO "1 3 6 1 5 5 2" +#define OID_NTLMSSP "1 3 6 1 4 1 311 2 2 10" +#define OID_KERBEROS5_OLD "1 2 840 48018 1 2 2" +#define OID_KERBEROS5 "1 2 840 113554 1 2 2" diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 11852a09cc..9186208d62 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -406,7 +406,7 @@ do a spnego/NTLMSSP encrypted session setup static BOOL cli_session_setup_ntlmssp(struct cli_state *cli, char *user, char *pass, char *workgroup) { - const char *mechs[] = {"1 3 6 1 4 1 311 2 2 10", NULL}; + const char *mechs[] = {OID_NTLMSSP, NULL}; DATA_BLOB msg1; DATA_BLOB blob, chal1, chal2, auth; uint8 challenge[8]; @@ -502,7 +502,7 @@ static BOOL cli_session_setup_spnego(struct cli_state *cli, char *user, /* make sure the server understands kerberos */ for (i=0;OIDs[i];i++) { DEBUG(3,("got OID=%s\n", OIDs[i])); - if (strcmp(OIDs[i], "1 2 840 48018 1 2 2") == 0) { + if (strcmp(OIDs[i], OID_KERBEROS5_OLD) == 0) { got_kerberos_mechanism = True; } free(OIDs[i]); diff --git a/source3/libsmb/clispnego.c b/source3/libsmb/clispnego.c index 6c6b18a923..6b705658c3 100644 --- a/source3/libsmb/clispnego.c +++ b/source3/libsmb/clispnego.c @@ -21,9 +21,6 @@ #include "includes.h" -#define OID_SPNEGO "1 3 6 1 5 5 2" -#define OID_KERBEROS5 "1 2 840 113554 1 2 2" - /* generate a negTokenInit packet given a GUID, a list of supported OIDs (the mechanisms) and a principle name string @@ -207,8 +204,7 @@ DATA_BLOB spnego_gen_negTokenTarg(struct cli_state *cli, char *principle) fstring service; char *realm; DATA_BLOB tkt, tkt_wrapped, targ; - const char *krb_mechs[] = - {"1 2 840 48018 1 2 2", "1 3 6 1 4 1 311 2 2 10", NULL}; + const char *krb_mechs[] = {OID_KERBEROS5_OLD, OID_NTLMSSP, NULL}; fstrcpy(service, principle); p = strchr_m(service, '@'); @@ -254,7 +250,7 @@ BOOL spnego_parse_challenge(DATA_BLOB blob, asn1_end_tag(&data); asn1_start_tag(&data,ASN1_CONTEXT(1)); - asn1_check_OID(&data, "1 3 6 1 4 1 311 2 2 10"); + asn1_check_OID(&data, OID_NTLMSSP); asn1_end_tag(&data); asn1_start_tag(&data,ASN1_CONTEXT(2)); -- cgit