Ok, I know it's a language thing and it shouldn't matter.... but a kerberos
authorJeremy Allison <jra@samba.org>
Sun, 21 Oct 2001 20:51:27 +0000 (20:51 +0000)
committerJeremy Allison <jra@samba.org>
Sun, 21 Oct 2001 20:51:27 +0000 (20:51 +0000)
name is a "principal", not a principle. English majors will complain :-).
Jeremy.

source/bin/.cvsignore
source/libsmb/cliconnect.c
source/libsmb/clikrb5.c
source/libsmb/clispnego.c
source/smbd/negprot.c
source/smbd/sesssetup.c

index c523d82795b66c249a9512257481f9221536e626..3dd83ab4267a2e40d9114786436d6e9c30944a1f 100644 (file)
@@ -7,6 +7,7 @@ make_smbcodepage
 make_unicodemap
 masktest
 msgtest
+net
 nmbd
 nmblookup
 pdbedit
index 11825ab0361278163b712d3a4d36bbc8d43e2afe..dc8c7c295737e67aa495f70d8b107f5dbd9d6420 100644 (file)
@@ -383,14 +383,14 @@ static DATA_BLOB cli_session_setup_blob(struct cli_state *cli, DATA_BLOB blob)
 /****************************************************************************
 do a spnego/kerberos encrypted session setup
 ****************************************************************************/
-static BOOL cli_session_setup_kerberos(struct cli_state *cli, char *principle, char *workgroup)
+static BOOL cli_session_setup_kerberos(struct cli_state *cli, char *principal, char *workgroup)
 {
        DATA_BLOB blob2, negTokenTarg;
 
        d_printf("Doing kerberos session setup\n");
 
        /* generate the encapsulated kerberos5 ticket */
-       negTokenTarg = spnego_gen_negTokenTarg(cli, principle);
+       negTokenTarg = spnego_gen_negTokenTarg(cli, principal);
 
        if (!negTokenTarg.data) return False;
 
@@ -505,7 +505,7 @@ do a spnego encrypted session setup
 static BOOL cli_session_setup_spnego(struct cli_state *cli, char *user, 
                                     char *pass, char *workgroup)
 {
-       char *principle;
+       char *principal;
        char *OIDs[ASN1_MAX_OIDS];
        uint8 guid[16];
        int i;
@@ -525,7 +525,7 @@ static BOOL cli_session_setup_spnego(struct cli_state *cli, char *user,
 
        /* the server sent us the first part of the SPNEGO exchange in the negprot 
           reply */
-       if (!spnego_parse_negTokenInit(cli->secblob, guid, OIDs, &principle)) {
+       if (!spnego_parse_negTokenInit(cli->secblob, guid, OIDs, &principal)) {
                return False;
        }
 
@@ -538,17 +538,17 @@ static BOOL cli_session_setup_spnego(struct cli_state *cli, char *user,
                }
                free(OIDs[i]);
        }
-       DEBUG(3,("got principle=%s\n", principle));
+       DEBUG(3,("got principal=%s\n", principal));
 
        fstrcpy(cli->user_name, user);
 
 #if HAVE_KRB5
        if (got_kerberos_mechanism && cli->use_kerberos) {
-               return cli_session_setup_kerberos(cli, principle, workgroup);
+               return cli_session_setup_kerberos(cli, principal, workgroup);
        }
 #endif
 
-       free(principle);
+       free(principal);
 
 ntlmssp:
 
index 5641692f2eea059cdcc1a9ea7ee839a7bdacd97f..b4ce271235ed7c6df9e5d2d5972f8ae1ab02da4b 100644 (file)
@@ -28,7 +28,7 @@
 static krb5_error_code krb5_mk_req2(krb5_context context, 
                                    krb5_auth_context *auth_context, 
                                    const krb5_flags ap_req_options,
-                                   const char *principle,
+                                   const char *principal,
                                    krb5_ccache ccache, 
                                    krb5_data *outbuf)
 {
@@ -38,9 +38,9 @@ static krb5_error_code krb5_mk_req2(krb5_context context,
        krb5_creds                creds;
        krb5_data in_data;
        
-       retval = krb5_parse_name(context, principle, &server);
+       retval = krb5_parse_name(context, principal, &server);
        if (retval) {
-               DEBUG(1,("Failed to parse principle %s\n", principle));
+               DEBUG(1,("Failed to parse principal %s\n", principal));
                return retval;
        }
        
@@ -87,7 +87,7 @@ cleanup_princ:
 /*
   get a kerberos5 ticket for the given service 
 */
-DATA_BLOB krb5_get_ticket(char *principle)
+DATA_BLOB krb5_get_ticket(char *principal)
 {
        krb5_error_code retval;
        krb5_data packet;
@@ -112,7 +112,7 @@ DATA_BLOB krb5_get_ticket(char *principle)
        if ((retval = krb5_mk_req2(context, 
                                   &auth_context, 
                                   0, 
-                                  principle,
+                                  principal,
                                   ccdef, &packet))) {
                goto failed;
        }
@@ -131,7 +131,7 @@ failed:
 
 #else /* HAVE_KRB5 */
  /* this saves a few linking headaches */
- DATA_BLOB krb5_get_ticket(char *principle)
+ DATA_BLOB krb5_get_ticket(char *principal)
  {
         DEBUG(0,("NO KERBEROS SUPPORT\n"));
         return data_blob(NULL, 0);
index bcce0f61737eb5c228a65c034446610a9dbc0602..784463566f3e9ddc8d2f80f7f745a83a40e7eda2 100644 (file)
 
 /*
   generate a negTokenInit packet given a GUID, a list of supported
-  OIDs (the mechanisms) and a principle name string 
+  OIDs (the mechanisms) and a principal name string 
 */
 DATA_BLOB spnego_gen_negTokenInit(uint8 guid[16], 
                                  const char *OIDs[], 
-                                 const char *principle)
+                                 const char *principal)
 {
        int i;
        ASN1_DATA data;
@@ -52,7 +52,7 @@ DATA_BLOB spnego_gen_negTokenInit(uint8 guid[16],
        asn1_push_tag(&data, ASN1_CONTEXT(3));
        asn1_push_tag(&data, ASN1_SEQUENCE(0));
        asn1_push_tag(&data, ASN1_CONTEXT(0));
-       asn1_write_GeneralString(&data,principle);
+       asn1_write_GeneralString(&data,principal);
        asn1_pop_tag(&data);
        asn1_pop_tag(&data);
        asn1_pop_tag(&data);
@@ -76,12 +76,12 @@ DATA_BLOB spnego_gen_negTokenInit(uint8 guid[16],
 
 /*
   parse a negTokenInit packet giving a GUID, a list of supported
-  OIDs (the mechanisms) and a principle name string 
+  OIDs (the mechanisms) and a principal name string 
 */
 BOOL spnego_parse_negTokenInit(DATA_BLOB blob,
                               uint8 guid[16], 
                               char *OIDs[ASN1_MAX_OIDS], 
-                              char **principle)
+                              char **principal)
 {
        int i;
        BOOL ret;
@@ -109,7 +109,7 @@ BOOL spnego_parse_negTokenInit(DATA_BLOB blob,
        asn1_start_tag(&data, ASN1_CONTEXT(3));
        asn1_start_tag(&data, ASN1_SEQUENCE(0));
        asn1_start_tag(&data, ASN1_CONTEXT(0));
-       asn1_read_GeneralString(&data,principle);
+       asn1_read_GeneralString(&data,principal);
        asn1_end_tag(&data);
        asn1_end_tag(&data);
        asn1_end_tag(&data);
@@ -269,13 +269,13 @@ BOOL spnego_parse_krb5_wrap(DATA_BLOB blob, DATA_BLOB *ticket)
    generate a SPNEGO negTokenTarg packet, ready for a EXTENDED_SECURITY
    kerberos session setup 
 */
-DATA_BLOB spnego_gen_negTokenTarg(struct cli_state *cli, char *principle)
+DATA_BLOB spnego_gen_negTokenTarg(struct cli_state *cli, char *principal)
 {
        DATA_BLOB tkt, tkt_wrapped, targ;
        const char *krb_mechs[] = {OID_KERBEROS5_OLD, OID_NTLMSSP, NULL};
 
        /* get a kerberos ticket for the service */
-       tkt = krb5_get_ticket(principle);
+       tkt = krb5_get_ticket(principal);
 
        /* wrap that up in a nice GSS-API wrapping */
        tkt_wrapped = spnego_gen_krb5_wrap(tkt);
index dc19e2bdfb3e6983aafd677745fd4abaf521449a..ecc6e7ee5140279ae0414b575933cd1e2efe8450 100644 (file)
@@ -166,7 +166,7 @@ static int negprot_spnego(char *p, uint8 cryptkey[8])
        const char *OIDs[] = {OID_NTLMSSP,
                              OID_KERBEROS5,
                              NULL};
-       char *principle;
+       char *principal;
        int len;
 
        memset(guid, 0, 16);
@@ -175,9 +175,9 @@ static int negprot_spnego(char *p, uint8 cryptkey[8])
 
        /* win2000 uses host$@REALM, which we will probably use eventually,
           but for now this works */
-       asprintf(&principle, "HOST/%s@%s", guid, lp_realm());
-       blob = spnego_gen_negTokenInit(guid, OIDs, principle);
-       free(principle);
+       asprintf(&principal, "HOST/%s@%s", guid, lp_realm());
+       blob = spnego_gen_negTokenInit(guid, OIDs, principal);
+       free(principal);
 
        memcpy(p, blob.data, blob.length);
        len = blob.length;
index 7f9a09c79b5d038ac2f259d5feddf5c4471fc62a..003cb0dc3d8b7da85fc7ec2aa6a4571a5889826c 100644 (file)
@@ -41,7 +41,7 @@ static int reply_spnego_kerberos(connection_struct *conn,
        int ret;
        char *realm, *client, *p;
        fstring hostname;
-       char *principle;
+       char *principal;
        extern pstring global_myname;
        const struct passwd *pw;
        char *user;
@@ -58,7 +58,7 @@ static int reply_spnego_kerberos(connection_struct *conn,
 
        fstrcpy(hostname, global_myname);
        strlower(hostname);
-       asprintf(&principle, "HOST/%s@%s", hostname, realm);
+       asprintf(&principal, "HOST/%s@%s", hostname, realm);
        
        ret = krb5_init_context(&context);
        if (ret) {
@@ -66,14 +66,14 @@ static int reply_spnego_kerberos(connection_struct *conn,
                return ERROR_NT(NT_STATUS_LOGON_FAILURE);
        }
 
-       ret = krb5_parse_name(context, principle, &server);
+       ret = krb5_parse_name(context, principal, &server);
        if (ret) {
                DEBUG(1,("krb5_parse_name(%s) failed (%s)\n", 
-                        principle, error_message(ret)));
+                        principal, error_message(ret)));
                return ERROR_NT(NT_STATUS_LOGON_FAILURE);
        }
 
-       free(principle);
+       free(principal);
 
        packet.length = ticket.length;
        packet.data = (krb5_pointer)ticket.data;
@@ -96,7 +96,7 @@ static int reply_spnego_kerberos(connection_struct *conn,
 
        p = strchr_m(client, '@');
        if (!p) {
-               DEBUG(3,("Doesn't look like a valid principle\n"));
+               DEBUG(3,("Doesn't look like a valid principal\n"));
                return ERROR_NT(NT_STATUS_LOGON_FAILURE);
        }