xref: /illumos-gate/usr/src/lib/pkcs11/libpkcs11/common/metaDualCrypt.c (revision 012e6ce759c490003aed29439cc47d3d73a99ad3)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * Dual-Function Cryptographic Functions
29  * (as defined in PKCS#11 spec section 11.13)
30  *
31  * These functions will not be supported in the this release.
32  * A call to these functions returns CKR_FUNCTION_NOT_SUPPORTED.
33  *
34  * Providing the support for dual-function crypto functions is
35  * not trivial.  C_FooInit() need to be called for the 2 crypto
36  * operations before any of these function can be called.
37  * When C_FooInit() is called, metaslot doesn't know if it is going
38  * to do dual-function crypto or single crypto operation.
39  * So, it has no way to pick the slot that supports both the mechanism
40  * it specified and supports dual-functions.
41  *
42  * In order for these dual functions to be supported in the future,
43  * metaslot need to simulate the dual-function crypto operations
44  * when both operations are not lucky enough be to initialized in
45  * the same slots that supports dual-functions.
46  */
47 
48 #include "metaGlobal.h"
49 
50 /*
51  * meta_DigestEncryptUpdate
52  *
53  */
54 /*ARGSUSED*/
55 CK_RV
56 meta_DigestEncryptUpdate(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart,
57     CK_ULONG ulPartLen, CK_BYTE_PTR pEncryptedPart,
58     CK_ULONG_PTR pulEncryptedPartLen)
59 {
60 	return (CKR_FUNCTION_NOT_SUPPORTED);
61 }
62 
63 /*
64  * meta_DecryptDigestUpdate
65  *
66  */
67 /*ARGSUSED*/
68 CK_RV
69 meta_DecryptDigestUpdate(CK_SESSION_HANDLE hSession,
70     CK_BYTE_PTR pEncryptedPart, CK_ULONG ulEncryptedPartLen,
71     CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen)
72 {
73 	return (CKR_FUNCTION_NOT_SUPPORTED);
74 }
75 
76 /*
77  * meta_SignEncryptUpdate
78  *
79  */
80 /*ARGSUSED*/
81 CK_RV
82 meta_SignEncryptUpdate(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart,
83     CK_ULONG ulPartLen, CK_BYTE_PTR pEncryptedPart,
84     CK_ULONG_PTR pulEncryptedPartLen)
85 {
86 	return (CKR_FUNCTION_NOT_SUPPORTED);
87 }
88 
89 /*
90  * meta_DecryptVerifyUpdate
91  *
92  */
93 /*ARGSUSED*/
94 CK_RV
95 meta_DecryptVerifyUpdate(CK_SESSION_HANDLE hSession,
96     CK_BYTE_PTR pEncryptedPart, CK_ULONG ulEncryptedPartLen,
97     CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen)
98 {
99 	return (CKR_FUNCTION_NOT_SUPPORTED);
100 }
101