/*
* 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 2000 by Cisco Systems, Inc. All rights reserved.
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* iSCSI Pseudo HBA Driver
*/
#include "chap.h"
#include "iscsi.h"
#include <sys/iscsi_protocol.h>
#include "iscsiAuthClient.h"
#include "persistent.h"
/*
* Authenticate a target's CHAP response.
*
* username - Incoming username from the the target.
* responseData - Incoming response data from the target.
*/
int
unsigned int responseLength)
{
return (iscsiAuthStatusFail);
}
/*
* the expected credentials are in the session
*/
"no incoming username configured to authenticate target",
return (iscsiAuthStatusFail);
}
"received incorrect username from target",
return (iscsiAuthStatusFail);
}
/* Check if RADIUS access is enabled */
int authStatus;
/*
* Radius enabled but configuration invalid -
* invalid condition
*/
return (iscsiAuthStatusFail);
}
/* Use RADIUS server to authentication target */
/* IPv4 */
= sizeof (in_addr_t);
/* IPv6 */
16);
} else {
return (iscsiAuthStatusFail);
}
/* Entry point to the CHAP authentication module. */
id,
(void *)&radius_cfg);
switch (chap_valid_status) {
case CHAP_VALIDATION_PASSED:
break;
break;
break;
break;
break;
default:
break;
}
return (authStatus);
} else {
/* Use target secret (if defined) to authenticate target */
/* No target secret defined - invalid condition */
return (iscsiAuthStatusFail);
}
/*
* challenge length is I->T, and shouldn't need to
* be checked
*/
if (responseLength != sizeof (verifyData)) {
"authentication, received incorrect CHAP response "
return (iscsiAuthStatusFail);
}
/*
* id byte
*/
verifyData[0] = id;
/*
* shared secret
*/
/*
* challenge value
*/
(uchar_t *)challengeData,
sizeof (verifyData)) == 0) {
return (iscsiAuthStatusPass);
}
"received incorrect CHAP response from target",
}
return (iscsiAuthStatusFail);
}
/* ARGSUSED */
void
{
}
int
{
char *pEnd;
unsigned long number;
return (1); /* Error */
}
} else {
return (1); /* Error */
}
}
return (0); /* No error */
} else {
return (1); /* Error */
}
}
/* ARGSUSED */
void
unsigned int length)
{
}
void
{
}
void
{
}
void
unsigned int length)
{
}
void
{
}
int
{
return (1); /* error */
}
return (0); /* no error */
}