svn rev #24602: trunk/src/ include/ lib/krb5/krb/

ghudson@MIT.EDU ghudson at MIT.EDU
Fri Jan 21 13:09:56 EST 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=24602
Commit By: ghudson
Log Message:
Add a trace log event for unrecognized enctypes in a profile enctype
list.



Changed Files:
U   trunk/src/include/k5-int.h
U   trunk/src/include/k5-trace.h
U   trunk/src/lib/krb5/krb/init_ctx.c
U   trunk/src/lib/krb5/krb/t_etypes.c
Modified: trunk/src/include/k5-int.h
===================================================================
--- trunk/src/include/k5-int.h	2011-01-21 05:00:53 UTC (rev 24601)
+++ trunk/src/include/k5-int.h	2011-01-21 18:09:56 UTC (rev 24602)
@@ -3018,7 +3018,8 @@
                                      unsigned int *nad_types,
                                      krb5_authdatatype **ad_types);
 
-krb5_error_code krb5int_parse_enctype_list(krb5_context context, char *profstr,
+krb5_error_code krb5int_parse_enctype_list(krb5_context context,
+                                           const char *profkey, char *profstr,
                                            krb5_enctype *default_list,
                                            krb5_enctype **result);
 

Modified: trunk/src/include/k5-trace.h
===================================================================
--- trunk/src/include/k5-trace.h	2011-01-21 05:00:53 UTC (rev 24601)
+++ trunk/src/include/k5-trace.h	2011-01-21 18:09:56 UTC (rev 24602)
@@ -149,6 +149,9 @@
 #define TRACE_GIC_PWD_MASTER(c) \
     TRACE(c, (c, "Retrying AS request with master KDC"))
 
+#define TRACE_ENCTYPE_LIST_UNKNOWN(c, profvar, name) \
+    TRACE(c, (c, "Unrecognized enctype name in {str}: {str}", profvar, name))
+
 #define TRACE_INIT_CREDS(c, princ) \
     TRACE(c, (c, "Getting initial credentials for {princ}", princ))
 #define TRACE_INIT_CREDS_AS_KEY_GAK(c, keyblock) \

Modified: trunk/src/lib/krb5/krb/init_ctx.c
===================================================================
--- trunk/src/lib/krb5/krb/init_ctx.c	2011-01-21 05:00:53 UTC (rev 24601)
+++ trunk/src/lib/krb5/krb/init_ctx.c	2011-01-21 18:09:56 UTC (rev 24602)
@@ -404,8 +404,9 @@
  * parsing profstr.  profstr may be modified during parsing.
  */
 krb5_error_code
-krb5int_parse_enctype_list(krb5_context context, char *profstr,
-                           krb5_enctype *default_list, krb5_enctype **result)
+krb5int_parse_enctype_list(krb5_context context, const char *profkey,
+                           char *profstr, krb5_enctype *default_list,
+                           krb5_enctype **result)
 {
     char *token, *delim = " \t\r\n,", *save = NULL;
     krb5_boolean sel, weak = context->allow_weak_crypto;
@@ -450,6 +451,8 @@
         } else if (krb5_string_to_enctype(token, &etype) == 0) {
             /* Set a specific enctype. */
             mod_list(etype, sel, weak, &list);
+        } else {
+            TRACE_ENCTYPE_LIST_UNKNOWN(context, profkey, token);
         }
     }
 
@@ -489,8 +492,8 @@
                                   profkey, NULL, "DEFAULT", &profstr);
         if (code)
             return code;
-        code = krb5int_parse_enctype_list(context, profstr, default_list,
-                                          &etypes);
+        code = krb5int_parse_enctype_list(context, profkey, profstr,
+                                          default_list, &etypes);
         profile_release_string(profstr);
         if (code)
             return code;

Modified: trunk/src/lib/krb5/krb/t_etypes.c
===================================================================
--- trunk/src/lib/krb5/krb/t_etypes.c	2011-01-21 05:00:53 UTC (rev 24601)
+++ trunk/src/lib/krb5/krb/t_etypes.c	2011-01-21 18:09:56 UTC (rev 24602)
@@ -238,8 +238,8 @@
 
             if (tests[i].str != NULL) {
                 copy = strdup(tests[i].str);
-                ret = krb5int_parse_enctype_list(ctx, copy, tests[i].defaults,
-                                                 &list);
+                ret = krb5int_parse_enctype_list(ctx, "", copy,
+                                                 tests[i].defaults, &list);
                 if (ret != expected_err) {
                     com_err("krb5int_parse_enctype_list", ret, "");
                     return 2;




More information about the cvs-krb5 mailing list