X-Git-Url: http://www.project-moonshot.org/gitweb/?p=moonshot.git;a=blobdiff_plain;f=moonshot%2Fmech_eap%2Finit_sec_context.c;fp=moonshot%2Fmech_eap%2Finit_sec_context.c;h=8a877fdbcb8c246e07d9c626675543304bd3be71;hp=e99b479fef7d72ab2de9e345ab10b359fdc6550b;hb=2ef42df0ecea8745a678fe26ff9b16072b93586b;hpb=8d4ead4156291d105b5a3e73a3380bffea17c235 diff --git a/moonshot/mech_eap/init_sec_context.c b/moonshot/mech_eap/init_sec_context.c index e99b479..8a877fd 100644 --- a/moonshot/mech_eap/init_sec_context.c +++ b/moonshot/mech_eap/init_sec_context.c @@ -250,14 +250,22 @@ peerConfigInit(OM_uint32 *minor, gss_ctx_id_t ctx) eapPeerConfig->anonymous_identity_len = 1 + realm.length; /* password */ - eapPeerConfig->password = (unsigned char *)cred->password.value; - eapPeerConfig->password_len = cred->password.length; + if ((cred->flags & CRED_FLAG_CERTIFICATE) == 0) { + eapPeerConfig->password = (unsigned char *)cred->password.value; + eapPeerConfig->password_len = cred->password.length; + } /* certs */ eapPeerConfig->ca_cert = (unsigned char *)cred->caCertificate.value; eapPeerConfig->subject_match = (unsigned char *)cred->subjectNameConstraint.value; eapPeerConfig->altsubject_match = (unsigned char *)cred->subjectAltNameConstraint.value; + if (cred->flags & CRED_FLAG_CERTIFICATE) { + eapPeerConfig->client_cert = (unsigned char *)cred->clientCertificate.value; + eapPeerConfig->private_key = (unsigned char *)cred->privateKey.value; + eapPeerConfig->private_key_passwd = (unsigned char *)cred->password.value; + } + *minor = 0; return GSS_S_COMPLETE; }