/*
- * Copyright (c) 2010, JANET(UK)
+ * Copyright (c) 2011, JANET(UK)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
}
if (actx->radServer != NULL) {
- if (rs_conn_select_server(actx->radConn, actx->radServer) != 0) {
+ if (rs_conn_select_peer(actx->radConn, actx->radServer) != 0) {
err = rs_err_conn_pop(actx->radConn);
goto fail;
}
rconn = ctx->acceptorCtx.radConn;
- if (rs_packet_create_acc_request(rconn, &req, NULL, NULL) != 0) {
+ if (rs_packet_create_authn_request(rconn, &req, NULL, NULL) != 0) {
major = gssEapRadiusMapError(minor, rs_err_conn_pop(rconn));
goto cleanup;
}
gss_release_buffer(&tmpMinor, &ctx->acceptorCtx.state);
}
- if (rs_request_create(rconn, &request) != 0 ||
- rs_request_send(request, req, &resp) != 0) {
+ if (rs_request_create(rconn, &request) != 0) {
+ major = gssEapRadiusMapError(minor, rs_err_conn_pop(rconn));
+ goto cleanup;
+ }
+
+ rs_request_add_reqpkt(request, req);
+ req = NULL;
+
+ if (rs_request_send(request, &resp) != 0) {
major = gssEapRadiusMapError(minor, rs_err_conn_pop(rconn));
goto cleanup;
}
major = GSS_S_CONTINUE_NEEDED;
cleanup:
- rs_request_destroy(request);
+ if (request != NULL)
+ rs_request_destroy(request);
+ if (req != NULL)
+ rs_packet_destroy(req);
return major;
}