* Mark a context as ready for cryptographic operations
*/
static OM_uint32
-acceptReady(OM_uint32 *minor, gss_ctx_id_t ctx)
+acceptReady(OM_uint32 *minor, gss_ctx_id_t ctx, gss_cred_id_t cred)
{
OM_uint32 major;
VALUE_PAIR *vp;
return major;
}
+ ctx->initiatorName->attrCtx = gssEapCreateAttrContext(cred, ctx);
+
vp = rc_avpair_get(ctx->acceptorCtx.avps, 0x01370010, 0);
if (ctx->encryptionType != ENCTYPE_NULL && vp != NULL) {
major = gssEapDeriveRfc3961Key(minor,
* material it seems confusing to the caller to advertise this.
*/
ctx->gssFlags &= ~(GSS_C_INTEG_FLAG | GSS_C_CONF_FLAG);
+ ctx->encryptionType = ENCTYPE_NULL;
}
major = sequenceInit(minor,
ctx->acceptorCtx.avps = received;
received = NULL;
- major = acceptReady(minor, ctx);
+ major = acceptReady(minor, ctx, cred);
if (GSS_ERROR(major))
goto cleanup;
* material it seems confusing to the caller to advertise this.
*/
ctx->gssFlags &= ~(GSS_C_INTEG_FLAG | GSS_C_CONF_FLAG);
+ ctx->encryptionType = ENCTYPE_NULL;
}
major = sequenceInit(minor,
}
OM_uint32
+addAvpFromBuffer(OM_uint32 *minor,
+ rc_handle *rh,
+ VALUE_PAIR **vp,
+ int type,
+ gss_buffer_t buffer)
+{
+ if (rc_avpair_add(rh, vp, type, buffer->value, buffer->length, 0) == NULL) {
+ return GSS_S_FAILURE;
+ }
+
+ return GSS_S_COMPLETE;
+}
+
+OM_uint32
+getBufferFromAvps(OM_uint32 *minor,
+ VALUE_PAIR *vps,
+ int type,
+ gss_buffer_t buffer,
+ int concat)
+{
+ VALUE_PAIR *vp;
+ unsigned char *p;
+
+ buffer->length = 0;
+ buffer->value = NULL;
+
+ vp = rc_avpair_get(vps, type, 0);
+ if (vp == NULL)
+ return GSS_S_UNAVAILABLE;
+
+ do {
+ buffer->length += vp->lvalue;
+ } while (concat && (vp = rc_avpair_get(vp->next, type, 0)) != NULL);
+
+ buffer->value = GSSEAP_MALLOC(buffer->length);
+ if (buffer->value == NULL) {
+ *minor = ENOMEM;
+ return GSS_S_FAILURE;
+ }
+
+ p = (unsigned char *)buffer->value;
+
+ for (vp = rc_avpair_get(vps, type, 0);
+ concat && vp != NULL;
+ vp = rc_avpair_get(vp->next, type, 0)) {
+ memcpy(p, vp->strvalue, vp->lvalue);
+ p += vp->lvalue;
+ }
+
+ *minor = 0;
+ return GSS_S_COMPLETE;
+}
+
+OM_uint32
gssEapRadiusAttrProviderInit(OM_uint32 *minor)
{
return gss_eap_radius_attr_provider::init()
extern "C" {
#endif
-static inline OM_uint32
+OM_uint32
addAvpFromBuffer(OM_uint32 *minor,
rc_handle *rh,
VALUE_PAIR **vp,
int type,
- gss_buffer_t buffer)
-{
- if (rc_avpair_add(rh, vp, type, buffer->value, buffer->length, 0) == NULL) {
- return GSS_S_FAILURE;
- }
+ gss_buffer_t buffer);
- return GSS_S_COMPLETE;
-}
-
-static inline OM_uint32
+OM_uint32
getBufferFromAvps(OM_uint32 *minor,
VALUE_PAIR *vps,
int type,
gss_buffer_t buffer,
- int concat)
-{
- VALUE_PAIR *vp;
- unsigned char *p;
-
- buffer->length = 0;
- buffer->value = NULL;
-
- vp = rc_avpair_get(vps, type, 0);
- if (vp == NULL)
- return GSS_S_UNAVAILABLE;
-
- do {
- buffer->length += vp->lvalue;
- } while (concat && (vp = rc_avpair_get(vp->next, type, 0)) != NULL);
-
- buffer->value = GSSEAP_MALLOC(buffer->length);
- if (buffer->value == NULL) {
- *minor = ENOMEM;
- return GSS_S_FAILURE;
- }
-
- p = (unsigned char *)buffer->value;
-
- for (vp = rc_avpair_get(vps, type, 0);
- concat && vp != NULL;
- vp = rc_avpair_get(vp->next, type, 0)) {
- memcpy(p, vp->strvalue, vp->lvalue);
- p += vp->lvalue;
- }
-
- *minor = 0;
- return GSS_S_COMPLETE;
-}
+ int concat);
OM_uint32 gssEapRadiusAttrProviderInit(OM_uint32 *minor);
OM_uint32 gssEapRadiusAttrProviderFinalize(OM_uint32 *minor);