]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Use global constant for string components of anonymous and wellknown
authorSam Hartman <hartmans@mit.edu>
Wed, 23 Dec 2009 21:10:44 +0000 (21:10 +0000)
committerSam Hartman <hartmans@mit.edu>
Wed, 23 Dec 2009 21:10:44 +0000 (21:10 +0000)
names.

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/anonymous@23508 dc483132-0cff-0310-8789-dd5450dbe970

src/clients/kinit/kinit.c
src/include/krb5/krb5.hin
src/lib/krb5/krb/bld_princ.c

index b6f83420af32e4d4bbca0d406f7311d3c226e5f4..1ecf6d4aa63e35553840cba71552a51cf1de8f00 100644 (file)
@@ -470,7 +470,9 @@ k5_begin(opts, k5)
         if (opts->anonymous) {
             code = krb5_build_principal_ext(k5->ctx, &k5->me, strlen(opts->principal_name),
                                             opts->principal_name,
-                                            9, "WELLKNOWN", 9, "ANONYMOUS", 0);
+                                            strlen(KRB5_WELLKNOWN_NAMESTR), KRB5_WELLKNOWN_NAMESTR,
+                                            strlen(KRB5_ANONYMOUS_PRINCSTR),
+                                            KRB5_ANONYMOUS_PRINCSTR, 0);
             if (code) {
                 com_err(progname, code, "while setting up anonymous principal");
                 return 0;
index 8e97fee294330e648deb14bcca84908b1f6c1141..ac89a3c729c3bd24399954fac2a651faf75e401b 100644 (file)
@@ -262,6 +262,7 @@ typedef krb5_principal_data * krb5_principal;
 /* Windows 2000 UPN */
 #define KRB5_NT_ENTERPRISE_PRINCIPAL    10
 #define KRB5_NT_WELLKNOWN 11
+#define KRB5_WELLKNOWN_NAMESTR "WELLKNOWN" /*first component of NT_WELLKNOWN principals*/
 /* Windows 2000 UPN and SID */
 #define KRB5_NT_MS_PRINCIPAL            -128
 /* NT 4 style name */
@@ -300,7 +301,8 @@ const krb5_data *KRB5_CALLCONV
 krb5_anonymous_realm(void);
 krb5_const_principal KRB5_CALLCONV
 krb5_anonymous_principal(void);
-
+#define KRB5_ANONYMOUS_REALMSTR "WELLKNOWN:ANONYMOUS"
+#define KRB5_ANONYMOUS_PRINCSTR "ANONYMOUS" /*wellknown name type*/
 /*
  * end "base-defs.h"
  */
index e4532ef6ef6f59537e3d41ae0a0981d147a80984..8378599d3b355d688f9a84a4dd42bfcd7e54af30 100644 (file)
@@ -190,12 +190,12 @@ krb5_build_principal(krb5_context context,
 
 /*Anonymous and well known principals*/
 static const char anon_realm_str[]
-= "WELLKNOWN:ANONYMOUS";
+= KRB5_ANONYMOUS_REALMSTR;
 static const krb5_data anon_realm_data = {
     KV5M_DATA, sizeof(anon_realm_str)-1,
     (char *) anon_realm_str};
-static const char wellknown_str[] = "WELLKNOWN";
-static const char anon_str[] = "ANONYMOUS";
+static const char wellknown_str[] = KRB5_WELLKNOWN_NAMESTR;
+static const char anon_str[] = KRB5_ANONYMOUS_PRINCSTR;
 static const krb5_data anon_princ_data[] = {
     {KV5M_DATA, sizeof(wellknown_str)-1, (char *) wellknown_str},
     {KV5M_DATA, sizeof(anon_str)-1, (char *)anon_str}