From: Greg Hudson Date: Wed, 5 Oct 2011 22:11:19 +0000 (+0000) Subject: Remove edata code in sample preauth plugins X-Git-Tag: krb5-1.10-alpha1~61 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=72dc9d3ca51e6b54f088f7dc6a68c38504cde1d9;p=krb5.git Remove edata code in sample preauth plugins The code assumes unstructured edata and would be somewhat annoying to reframe in terms of pa-data. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25314 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/plugins/preauth/cksum_body/cksum_body_main.c b/src/plugins/preauth/cksum_body/cksum_body_main.c index 144ab6d96..794cd2ffb 100644 --- a/src/plugins/preauth/cksum_body/cksum_body_main.c +++ b/src/plugins/preauth/cksum_body/cksum_body_main.c @@ -347,7 +347,6 @@ server_verify(krb5_context kcontext, 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 @@ server_verify(krb5_context kcontext, 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 @@ server_verify(krb5_context kcontext, #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 @@ server_verify(krb5_context kcontext, /* 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. */ diff --git a/src/plugins/preauth/wpse/wpse_main.c b/src/plugins/preauth/wpse/wpse_main.c index e3f5d8782..e437d6b03 100644 --- a/src/plugins/preauth/wpse/wpse_main.c +++ b/src/plugins/preauth/wpse/wpse_main.c @@ -271,7 +271,6 @@ server_verify(krb5_context kcontext, void *arg) { krb5_int32 nnonce; - krb5_data *test_edata; krb5_authdata **my_authz_data; krb5_kdcpreauth_modreq modreq; @@ -349,20 +348,7 @@ server_verify(krb5_context kcontext, #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. */