/*
* 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
*/
/*
*/
#include <string.h>
#include <security/cryptoki.h>
#include <cryptoutil.h>
/*
* smb_auth_md4
*
* Compute an MD4 digest.
*/
int
{
return (SMBAUTH_SUCCESS);
}
/* 16-byte MD5 digest */
int
{
mechanism.pParameter = 0;
mechanism.ulParameterLen = 0;
return (SMBAUTH_FAILURE);
/* Initialize the digest operation in the session */
goto cleanup;
goto cleanup;
goto cleanup;
(void) C_CloseSession(hSession);
return (rc);
}
int
int data_len,
const unsigned char *key,
int key_len,
unsigned char *digest)
{
mechanism.pParameter = 0;
mechanism.ulParameterLen = 0;
return (SMBAUTH_FAILURE);
}
(void) C_CloseSession(hSession);
return (SMBAUTH_FAILURE);
}
/* Initialize the digest operation in the session */
(void) C_CloseSession(hSession);
return (SMBAUTH_FAILURE);
}
(void) C_CloseSession(hSession);
return (SMBAUTH_FAILURE);
}
(void) C_CloseSession(hSession);
return (SMBAUTH_FAILURE);
}
(void) C_CloseSession(hSession);
if (diglen != MD_DIGEST_LEN) {
return (SMBAUTH_FAILURE);
}
return (SMBAUTH_SUCCESS);
}
int
{
int error = 0;
int K, D;
int k, d;
/* Calculate proper number of iterations */
K = KeyLen / 7;
D = DataLen / 8;
if (ResultLen < (K * 8 * D)) {
return (SMBAUTH_FAILURE);
}
/*
* Use SUNW convenience function to initialize the cryptoki
* library, and open a session with a slot that supports
* the mechanism we plan on using.
*/
mechanism.ulParameterLen = 0;
return (SMBAUTH_FAILURE);
}
for (k = 0; k < K; k++) {
error = 1;
goto exit_session;
}
/* Initialize the encryption operation in the session */
error = 1;
goto exit_encrypt;
}
for (d = 0; d < D; d++) {
/* Read in the data and encrypt this portion */
error = 1;
goto exit_encrypt;
}
}
}
goto exit_session;
(void) C_CloseSession(hSession);
if (error)
return (SMBAUTH_FAILURE);
return (SMBAUTH_SUCCESS);
}
/*
* See "Netlogon Credential Computation" section of MS-NRPC document.
*/
static void
{
int i;
for (i = 0; i < 8; i++)
}