xref: /titanic_51/usr/src/lib/pkcs11/libpkcs11/common/metaDualCrypt.c (revision 1e49577a7fcde812700ded04431b49d67cc57d6d)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 /*
30  * Dual-Function Cryptographic Functions
31  * (as defined in PKCS#11 spec section 11.13)
32  *
33  * These functions will not be supported in the this release.
34  * A call to these functions returns CKR_FUNCTION_NOT_SUPPORTED.
35  *
36  * Providing the support for dual-function crypto functions is
37  * not trivial.  C_FooInit() need to be called for the 2 crypto
38  * operations before any of these function can be called.
39  * When C_FooInit() is called, metaslot doesn't know if it is going
40  * to do dual-function crypto or single crypto operation.
41  * So, it has no way to pick the slot that supports both the mechanism
42  * it specified and supports dual-functions.
43  *
44  * In order for these dual functions to be supported in the future,
45  * metaslot need to simulate the dual-function crypto operations
46  * when both operations are not lucky enough be to initialized in
47  * the same slots that supports dual-functions.
48  */
49 
50 #include "metaGlobal.h"
51 
52 /*
53  * meta_DigestEncryptUpdate
54  *
55  */
56 /*ARGSUSED*/
57 CK_RV
58 meta_DigestEncryptUpdate(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart,
59     CK_ULONG ulPartLen, CK_BYTE_PTR pEncryptedPart,
60     CK_ULONG_PTR pulEncryptedPartLen)
61 {
62 	return (CKR_FUNCTION_NOT_SUPPORTED);
63 }
64 
65 /*
66  * meta_DecryptDigestUpdate
67  *
68  */
69 /*ARGSUSED*/
70 CK_RV
71 meta_DecryptDigestUpdate(CK_SESSION_HANDLE hSession,
72     CK_BYTE_PTR pEncryptedPart, CK_ULONG ulEncryptedPartLen,
73     CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen)
74 {
75 	return (CKR_FUNCTION_NOT_SUPPORTED);
76 }
77 
78 /*
79  * meta_SignEncryptUpdate
80  *
81  */
82 /*ARGSUSED*/
83 CK_RV
84 meta_SignEncryptUpdate(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart,
85     CK_ULONG ulPartLen, CK_BYTE_PTR pEncryptedPart,
86     CK_ULONG_PTR pulEncryptedPartLen)
87 {
88 	return (CKR_FUNCTION_NOT_SUPPORTED);
89 }
90 
91 /*
92  * meta_DecryptVerifyUpdate
93  *
94  */
95 /*ARGSUSED*/
96 CK_RV
97 meta_DecryptVerifyUpdate(CK_SESSION_HANDLE hSession,
98     CK_BYTE_PTR pEncryptedPart, CK_ULONG ulEncryptedPartLen,
99     CK_BYTE_PTR pPart, CK_ULONG_PTR pulPartLen)
100 {
101 	return (CKR_FUNCTION_NOT_SUPPORTED);
102 }
103