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
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.
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]
23 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include <security/cryptoki.h>
30 #include "softGlobal.h"
31 #include "softSession.h"
32 #include "softObject.h"
36 C_DigestEncryptUpdate(CK_SESSION_HANDLE hSession
, CK_BYTE_PTR pPart
,
37 CK_ULONG ulPartLen
, CK_BYTE_PTR pEncryptedPart
,
38 CK_ULONG_PTR pulEncryptedPartLen
)
44 * All the front-end checkings will be done in the
45 * C_EncryptUpdate and C_DigestUpdate.
47 rv
= C_EncryptUpdate(hSession
, pPart
, ulPartLen
,
48 pEncryptedPart
, pulEncryptedPartLen
);
54 * If the application just wants to know the length of output
55 * buffer, then we do not digest the data.
57 if (pEncryptedPart
== NULL
)
60 return (C_DigestUpdate(hSession
, pPart
, ulPartLen
));
65 C_DecryptDigestUpdate(CK_SESSION_HANDLE hSession
, CK_BYTE_PTR pEncryptedPart
,
66 CK_ULONG ulEncryptedPartLen
, CK_BYTE_PTR pPart
, CK_ULONG_PTR pulPartLen
)
72 * All the front-end checkings will be done in the
73 * C_DecryptUpdate and C_DigestUpdate.
75 rv
= C_DecryptUpdate(hSession
, pEncryptedPart
, ulEncryptedPartLen
,
82 * If the application just wants to know the length of output
83 * buffer, then we do not digest the data.
88 return (C_DigestUpdate(hSession
, pPart
, *pulPartLen
));
93 C_SignEncryptUpdate(CK_SESSION_HANDLE hSession
, CK_BYTE_PTR pPart
,
94 CK_ULONG ulPartLen
, CK_BYTE_PTR pEncryptedPart
,
95 CK_ULONG_PTR pulEncryptedPartLen
)
101 * All the front-end checkings will be done in the
102 * C_EncryptUpdate and C_SignUpdate.
104 rv
= C_EncryptUpdate(hSession
, pPart
, ulPartLen
,
105 pEncryptedPart
, pulEncryptedPartLen
);
111 * If the application just wants to know the length of output
112 * buffer, then we do not sign the data.
114 if (pEncryptedPart
== NULL
)
117 return (C_SignUpdate(hSession
, pPart
, ulPartLen
));
122 C_DecryptVerifyUpdate(CK_SESSION_HANDLE hSession
, CK_BYTE_PTR pEncryptedPart
,
123 CK_ULONG ulEncryptedPartLen
, CK_BYTE_PTR pPart
, CK_ULONG_PTR pulPartLen
)
129 * All the front-end checkings will be done in the
130 * C_DecryptUpdate and C_VerifyUpdate.
132 rv
= C_DecryptUpdate(hSession
, pEncryptedPart
, ulEncryptedPartLen
,
139 * If the application just wants to know the length of output
140 * buffer, then we do not verify the data.
145 return (C_VerifyUpdate(hSession
, pPart
, *pulPartLen
));