svn rev #23486: branches/anonymous/src/ include/krb5/ lib/krb5/ lib/krb5/krb/
hartmans@MIT.EDU
hartmans at MIT.EDU
Wed Dec 23 15:59:03 EST 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=23486
Commit By: hartmans
Log Message:
Add anonymous principal and name type
Changed Files:
U branches/anonymous/src/include/krb5/krb5.hin
U branches/anonymous/src/lib/krb5/krb/bld_princ.c
U branches/anonymous/src/lib/krb5/libkrb5.exports
Modified: branches/anonymous/src/include/krb5/krb5.hin
===================================================================
--- branches/anonymous/src/include/krb5/krb5.hin 2009-12-23 20:46:23 UTC (rev 23485)
+++ branches/anonymous/src/include/krb5/krb5.hin 2009-12-23 20:59:03 UTC (rev 23486)
@@ -261,6 +261,7 @@
#define KRB5_NT_SMTP_NAME 7
/* Windows 2000 UPN */
#define KRB5_NT_ENTERPRISE_PRINCIPAL 10
+#define KRB5_NT_WELLKNOWN 11
/* Windows 2000 UPN and SID */
#define KRB5_NT_MS_PRINCIPAL -128
/* NT 4 style name */
@@ -293,6 +294,13 @@
*/
krb5_boolean KRB5_CALLCONV krb5_is_referral_realm(const krb5_data *);
+/*Both these functions return constant storage that must not be freed*/
+
+const krb5_data *KRB5_CALLCONV
+krb5_anonymous_realm(void);
+krb5_const_principal KRB5_CALLCONV
+krb5_anonymous_principal(void);
+
/*
* 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 20:46:23 UTC (rev 23485)
+++ branches/anonymous/src/lib/krb5/krb/bld_princ.c 2009-12-23 20:59:03 UTC (rev 23486)
@@ -187,3 +187,33 @@
return retval;
}
+
+/*Anonymous and well known principals*/
+static const char anon_realm_str[]
+= "WELLKNOWN:ANONYMOUS";
+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 krb5_data anon_princ_data[] = {
+ {KV5M_DATA, sizeof(wellknown_str)-1, (char *) wellknown_str},
+ {KV5M_DATA, sizeof(anon_str)-1, (char *)anon_str}
+};
+
+const krb5_principal_data anon_princ = {
+ KV5M_PRINCIPAL,
+ {KV5M_DATA, sizeof(anon_realm_str)-1, (char *) anon_realm_str},
+ (krb5_data *) anon_princ_data, 2, KRB5_NT_WELLKNOWN
+};
+
+const krb5_data * KRB5_CALLCONV
+krb5_anonymous_realm()
+{
+ return &anon_realm_data;
+}
+krb5_const_principal KRB5_CALLCONV
+krb5_anonymous_principal()
+{
+ return &anon_princ;
+}
Modified: branches/anonymous/src/lib/krb5/libkrb5.exports
===================================================================
--- branches/anonymous/src/lib/krb5/libkrb5.exports 2009-12-23 20:46:23 UTC (rev 23485)
+++ branches/anonymous/src/lib/krb5/libkrb5.exports 2009-12-23 20:59:03 UTC (rev 23486)
@@ -109,6 +109,8 @@
krb5_address_order
krb5_address_search
krb5_aname_to_localname
+krb5_anonymous_principal
+krb5_anonymous_realm
krb5_appdefault_boolean
krb5_appdefault_string
krb5_auth_con_free
More information about the cvs-krb5
mailing list