/*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2005 International Business
* Machines Corporation. All Rights Reserved.
*
* it under the terms of the Common Public License as published by
* IBM Corporation; either version 1 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Common Public License for more details.
*
* You should have received a copy of the Common Public License
* along with this program; if not, a copy can be viewed at
*/
/* (C) COPYRIGHT International Business Machines Corp. 2001, 2002, 2005 */
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "tpmtok_int.h"
{
if (! sess) {
return (CKR_FUNCTION_FAILED);
}
return (CKR_OPERATION_ACTIVE);
}
if (operation == OP_DECRYPT_INIT) {
&key_obj);
return (CKR_KEY_HANDLE_INVALID);
}
CKA_DECRYPT, &attr);
return (CKR_KEY_FUNCTION_NOT_PERMITTED);
} else {
return (CKR_KEY_FUNCTION_NOT_PERMITTED);
}
}
&key_obj);
return (CKR_WRAPPING_KEY_HANDLE_INVALID);
}
CKA_UNWRAP, &attr);
return (CKR_FUNCTION_FAILED);
} else {
return (CKR_FUNCTION_FAILED);
}
}
} else {
return (CKR_FUNCTION_FAILED);
}
case CKM_RSA_PKCS:
{
if (mech->ulParameterLen != 0)
return (CKR_MECHANISM_PARAM_INVALID);
CKA_KEY_TYPE, &attr);
return (CKR_KEY_TYPE_INCONSISTENT);
} else {
return (CKR_KEY_TYPE_INCONSISTENT);
}
}
ctx->context_len = 0;
}
break;
default:
return (CKR_MECHANISM_INVALID);
}
if (mech->ulParameterLen > 0) {
if (! ptr) {
return (CKR_HOST_MEMORY);
}
}
return (CKR_OK);
}
{
if (! ctx) {
return (CKR_FUNCTION_FAILED);
}
ctx->context_len = 0;
}
}
return (CKR_OK);
}
{
return (CKR_FUNCTION_FAILED);
}
return (CKR_OPERATION_NOT_INITIALIZED);
}
return (CKR_FUNCTION_FAILED);
}
return (CKR_OPERATION_ACTIVE);
}
case CKM_RSA_PKCS:
out_data_len));
default:
return (CKR_MECHANISM_INVALID);
}
}