svn rev #23508: branches/anonymous/src/ clients/kinit/ include/krb5/ lib/krb5/krb/

hartmans@MIT.EDU hartmans at MIT.EDU
Wed Dec 23 16:10:44 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=23508
Commit By: hartmans
Log Message:
Use global constant for string components of anonymous and wellknown
names.


Changed Files:
U   branches/anonymous/src/clients/kinit/kinit.c
U   branches/anonymous/src/include/krb5/krb5.hin
U   branches/anonymous/src/lib/krb5/krb/bld_princ.c
Modified: branches/anonymous/src/clients/kinit/kinit.c
===================================================================
--- branches/anonymous/src/clients/kinit/kinit.c	2009-12-23 21:10:40 UTC (rev 23507)
+++ branches/anonymous/src/clients/kinit/kinit.c	2009-12-23 21:10:44 UTC (rev 23508)
@@ -470,7 +470,9 @@
         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;

Modified: branches/anonymous/src/include/krb5/krb5.hin
===================================================================
--- branches/anonymous/src/include/krb5/krb5.hin	2009-12-23 21:10:40 UTC (rev 23507)
+++ branches/anonymous/src/include/krb5/krb5.hin	2009-12-23 21:10:44 UTC (rev 23508)
@@ -262,6 +262,7 @@
 /* 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 @@
 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"
  */

Modified: branches/anonymous/src/lib/krb5/krb/bld_princ.c
===================================================================
--- branches/anonymous/src/lib/krb5/krb/bld_princ.c	2009-12-23 21:10:40 UTC (rev 23507)
+++ branches/anonymous/src/lib/krb5/krb/bld_princ.c	2009-12-23 21:10:44 UTC (rev 23508)
@@ -190,12 +190,12 @@
 
 /*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}




More information about the cvs-krb5 mailing list