/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "chap.h"
#include "iscsi.h"
#include "radius_packet.h"
#include "radius_protocol.h"
#include "radius_auth.h"
/* Forward declaration */
/*
* Annotate the radius_attr_t objects with authentication data.
*/
static
void
char *target_chap_name,
unsigned char *target_response,
/*
* See radius_auth.h.
*/
/* ARGSUSED */
char *initiator_chap_name,
{
int rcv_status;
void *socket;
if (rad_svr_shared_secret_len == 0) {
/* The secret must not be empty (section 3, RFC 2865) */
return (CHAP_VALIDATION_BAD_RADIUS_SECRET);
}
/* Prepare the request authenticator */
/* First, the shared secret */
/* Then a unique number - use lbolt plus a random number */
(void) random_get_pseudo_bytes(random_number,
sizeof (random_number));
/* Error obtaining socket for RADIUS use */
return (CHAP_VALIDATION_RADIUS_ACCESS_ERROR);
}
/* Send the authentication access request to the RADIUS server */
if (snd_radius_request(socket,
&req) == -1) {
return (CHAP_VALIDATION_RADIUS_ACCESS_ERROR);
}
/* Analyze the response coming through from the same socket. */
if (rcv_status == RAD_RSP_RCVD_SUCCESS) {
} else {
}
} else if (rcv_status == RAD_RSP_RCVD_AUTH_FAILED) {
} else {
}
return (validation_status);
}
/* See forward declaration. */
static void
char *target_chap_name,
unsigned char *target_response,
{
(const char *)target_chap_name,
/* A target response is an MD5 hash thus its length has to be 16. */
/* 3 attributes associated with each RADIUS packet. */
}