From d7d74867952fdd7335f22981c66a67a61dc6e434 Mon Sep 17 00:00:00 2001 From: Zhanna Tsitkov Date: Thu, 18 Apr 2013 14:56:39 -0400 Subject: Use macro for IANA assigned PA-AS-CHECKSUM number Replace numeric value '132' by the macro KRB5_PADATA_AS_CHECKSUM in preauth plugin. --- src/plugins/preauth/pkinit/pkinit_clnt.c | 2 +- src/plugins/preauth/pkinit/pkinit_srv.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/preauth/pkinit/pkinit_clnt.c b/src/plugins/preauth/pkinit/pkinit_clnt.c index 75b97c6a80..ff564ff86b 100644 --- a/src/plugins/preauth/pkinit/pkinit_clnt.c +++ b/src/plugins/preauth/pkinit/pkinit_clnt.c @@ -198,7 +198,7 @@ pa_pkinit_gen_req(krb5_context context, */ if ((return_pa_data[0]->pa_type == KRB5_PADATA_PK_AS_REP_OLD && reqctx->opts->win2k_require_cksum) || (longhorn == 1)) { - return_pa_data[1]->pa_type = 132; + return_pa_data[1]->pa_type = KRB5_PADATA_AS_CHECKSUM; return_pa_data[1]->length = 0; return_pa_data[1]->contents = NULL; } else { diff --git a/src/plugins/preauth/pkinit/pkinit_srv.c b/src/plugins/preauth/pkinit/pkinit_srv.c index 0f5ab32c59..40ac8f97fb 100644 --- a/src/plugins/preauth/pkinit/pkinit_srv.c +++ b/src/plugins/preauth/pkinit/pkinit_srv.c @@ -863,13 +863,14 @@ pkinit_server_return_padata(krb5_context context, goto cleanup; } - /* check if PA_TYPE of 132 is present which means the client is - * requesting that a checksum is send back instead of the nonce + /* check if PA_TYPE of KRB5_PADATA_AS_CHECKSUM (132) is present which + * means the client is requesting that a checksum is send back instead + * of the nonce. */ for (i = 0; request->padata[i] != NULL; i++) { pkiDebug("%s: Checking pa_type 0x%08x\n", __FUNCTION__, request->padata[i]->pa_type); - if (request->padata[i]->pa_type == 132) + if (request->padata[i]->pa_type == KRB5_PADATA_AS_CHECKSUM) fixed_keypack = 1; } pkiDebug("%s: return checksum instead of nonce = %d\n", -- cgit