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;
/* 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 */
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"
*/
/*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}