/*
* 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 <strings.h>
#include <errno.h>
#include <security/cryptoki.h>
#include <cryptoutil.h>
#include "kmsGlobal.h"
#include "kmsSession.h"
#include "kmsObject.h"
#include "kmsKeystoreUtil.h"
static CK_RV
{
return (CKR_HOST_MEMORY);
OBJ_SEC_VALUE_LEN(keyp)) < 0)
return (CKR_DEVICE_ERROR);
return (CKR_OK);
}
{
if (!kms_initialized)
return (CKR_CRYPTOKI_NOT_INITIALIZED);
/* Obtain the session pointer */
return (rv);
goto failed_exit;
}
goto failed_exit;
}
switch (pMechanism->mechanism) {
case CKM_AES_KEY_GEN:
break;
default:
goto failed_exit;
/* NOTREACHED */
break;
}
/* Create an object record */
new_objp = kms_new_object();
return (CKR_HOST_MEMORY);
goto failed_exit;
/*
* Generate the KMS key.
*
* This will put the AES key value from the KMS key into the
* key object record.
*/
else
goto failed_exit;
pslot = get_slotinfo();
goto failed_exit;
}
} else {
}
return (rv);
return (rv);
}
/*ARGSUSED*/
{
if (!kms_initialized)
return (CKR_CRYPTOKI_NOT_INITIALIZED);
return (CKR_FUNCTION_NOT_SUPPORTED);
}
/*ARGSUSED*/
{
if (!kms_initialized)
return (CKR_CRYPTOKI_NOT_INITIALIZED);
return (CKR_FUNCTION_NOT_SUPPORTED);
}
/*ARGSUSED*/
{
if (!kms_initialized)
return (CKR_CRYPTOKI_NOT_INITIALIZED);
return (CKR_FUNCTION_NOT_SUPPORTED);
}
/*ARGSUSED*/
{
if (!kms_initialized)
return (CKR_CRYPTOKI_NOT_INITIALIZED);
return (CKR_FUNCTION_NOT_SUPPORTED);
}