svn rev #25314: trunk/src/plugins/preauth/ cksum_body/ wpse/

ghudson@MIT.EDU ghudson at MIT.EDU
Wed Oct 5 18:11:20 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=25314
Commit By: ghudson
Log Message:
Remove edata code in sample preauth plugins.

The code assumes unstructured edata and would be somewhat annoying to
reframe in terms of pa-data.


Changed Files:
U   trunk/src/plugins/preauth/cksum_body/cksum_body_main.c
U   trunk/src/plugins/preauth/wpse/wpse_main.c
Modified: trunk/src/plugins/preauth/cksum_body/cksum_body_main.c
===================================================================
--- trunk/src/plugins/preauth/cksum_body/cksum_body_main.c	2011-10-05 21:31:08 UTC (rev 25313)
+++ trunk/src/plugins/preauth/cksum_body/cksum_body_main.c	2011-10-05 22:11:19 UTC (rev 25314)
@@ -347,7 +347,6 @@
     krb5_cksumtype *cksumtypes;
     krb5_error_code status;
     struct server_stats *stats;
-    krb5_data *test_edata;
     test_svr_req_ctx *svr_req_ctx;
     krb5_authdata **my_authz_data = NULL;
 
@@ -480,20 +479,8 @@
             fprintf(stderr, "Checksum mismatch.\n");
         }
 #endif
-        /* Return edata to exercise code that handles edata... */
-        test_edata = malloc(sizeof(*test_edata));
-        if (test_edata != NULL) {
-            test_edata->data = malloc(20);
-            if (test_edata->data == NULL) {
-                free(test_edata);
-                test_edata = NULL;
-            } else {
-                test_edata->length = 20;
-                memset(test_edata->data, 'F', 20); /* fill it with junk */
-            }
-        }
         stats->failures++;
-        (*respond)(arg, KRB5KDC_ERR_PREAUTH_FAILED, NULL, test_edata, NULL);
+        (*respond)(arg, KRB5KDC_ERR_PREAUTH_FAILED, NULL, NULL, NULL);
         return;
     }
 
@@ -550,19 +537,6 @@
 #endif
     }
 
-    /* Return edata to exercise code that handles edata... */
-    test_edata = malloc(sizeof(*test_edata));
-    if (test_edata != NULL) {
-        test_edata->data = malloc(20);
-        if (test_edata->data == NULL) {
-            free(test_edata);
-            test_edata = NULL;
-        } else {
-            test_edata->length = 20;
-            memset(test_edata->data, 'S', 20); /* fill it with junk */
-        }
-    }
-
     /* Return a request context to exercise code that handles it */
     svr_req_ctx = malloc(sizeof(*svr_req_ctx));
     if (svr_req_ctx != NULL) {
@@ -577,8 +551,7 @@
     /* Note that preauthentication succeeded. */
     enc_tkt_reply->flags |= TKT_FLG_PRE_AUTH;
     stats->successes++;
-    (*respond)(arg, 0, (krb5_kdcpreauth_modreq)svr_req_ctx, test_edata,
-               my_authz_data);
+    (*respond)(arg, 0, (krb5_kdcpreauth_modreq)svr_req_ctx, NULL, my_authz_data);
 }
 
 /* Create the response for a client. */

Modified: trunk/src/plugins/preauth/wpse/wpse_main.c
===================================================================
--- trunk/src/plugins/preauth/wpse/wpse_main.c	2011-10-05 21:31:08 UTC (rev 25313)
+++ trunk/src/plugins/preauth/wpse/wpse_main.c	2011-10-05 22:11:19 UTC (rev 25314)
@@ -271,7 +271,6 @@
               void *arg)
 {
     krb5_int32 nnonce;
-    krb5_data *test_edata;
     krb5_authdata **my_authz_data;
     krb5_kdcpreauth_modreq modreq;
 
@@ -349,20 +348,7 @@
 #endif
     }
 
-    /* Return edata to exercise code that handles edata... */
-    test_edata = malloc(sizeof(*test_edata));
-    if (test_edata != NULL) {
-        test_edata->data = malloc(20);
-        if (test_edata->data == NULL) {
-            free(test_edata);
-            test_edata = NULL;
-        } else {
-            test_edata->length = 20;
-            memset(test_edata->data, '#', 20); /* fill it with junk */
-        }
-    }
-
-    (*respond)(arg, 0, modreq, test_edata, my_authz_data);
+    (*respond)(arg, 0, modreq, NULL, my_authz_data);
 }
 
 /* Create the response for a client. */




More information about the cvs-krb5 mailing list