xref: /onnv-gate/usr/src/lib/libkmsagent/common/KMSAgentKeyCallout.cpp (revision 12720:3db6e0082404)
1*12720SWyllys.Ingersoll@Sun.COM /*
2*12720SWyllys.Ingersoll@Sun.COM  * CDDL HEADER START
3*12720SWyllys.Ingersoll@Sun.COM  *
4*12720SWyllys.Ingersoll@Sun.COM  * The contents of this file are subject to the terms of the
5*12720SWyllys.Ingersoll@Sun.COM  * Common Development and Distribution License (the "License").
6*12720SWyllys.Ingersoll@Sun.COM  * You may not use this file except in compliance with the License.
7*12720SWyllys.Ingersoll@Sun.COM  *
8*12720SWyllys.Ingersoll@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*12720SWyllys.Ingersoll@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*12720SWyllys.Ingersoll@Sun.COM  * See the License for the specific language governing permissions
11*12720SWyllys.Ingersoll@Sun.COM  * and limitations under the License.
12*12720SWyllys.Ingersoll@Sun.COM  *
13*12720SWyllys.Ingersoll@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*12720SWyllys.Ingersoll@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*12720SWyllys.Ingersoll@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*12720SWyllys.Ingersoll@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*12720SWyllys.Ingersoll@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*12720SWyllys.Ingersoll@Sun.COM  *
19*12720SWyllys.Ingersoll@Sun.COM  * CDDL HEADER END
20*12720SWyllys.Ingersoll@Sun.COM  */
21*12720SWyllys.Ingersoll@Sun.COM 
22*12720SWyllys.Ingersoll@Sun.COM /*
23*12720SWyllys.Ingersoll@Sun.COM  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
24*12720SWyllys.Ingersoll@Sun.COM  */
25*12720SWyllys.Ingersoll@Sun.COM 
26*12720SWyllys.Ingersoll@Sun.COM #include "KMSAgentKeyCallout.h"
27*12720SWyllys.Ingersoll@Sun.COM 
28*12720SWyllys.Ingersoll@Sun.COM #ifdef METAWARE
29*12720SWyllys.Ingersoll@Sun.COM extern "C" int ecpt_get_pc_key_and_xor( unsigned char * key );
30*12720SWyllys.Ingersoll@Sun.COM #endif
31*12720SWyllys.Ingersoll@Sun.COM 
32*12720SWyllys.Ingersoll@Sun.COM /**
33*12720SWyllys.Ingersoll@Sun.COM  *  Hook function to get the key in the clear (XOR is presently used)
34*12720SWyllys.Ingersoll@Sun.COM  *  @returns 0=ok, nonzero = bad
35*12720SWyllys.Ingersoll@Sun.COM  */
KMSAgentKeyCallout(unsigned char io_aKey[KMS_MAX_KEY_SIZE])36*12720SWyllys.Ingersoll@Sun.COM int KMSAgentKeyCallout( unsigned char io_aKey[KMS_MAX_KEY_SIZE] )
37*12720SWyllys.Ingersoll@Sun.COM {
38*12720SWyllys.Ingersoll@Sun.COM #ifndef METAWARE
39*12720SWyllys.Ingersoll@Sun.COM     return 0;
40*12720SWyllys.Ingersoll@Sun.COM #else
41*12720SWyllys.Ingersoll@Sun.COM     return ecpt_get_pc_key_and_xor( io_aKey );
42*12720SWyllys.Ingersoll@Sun.COM #endif
43*12720SWyllys.Ingersoll@Sun.COM }
44