xref: /titanic_41/usr/src/uts/common/gssapi/mechs/krb5/mech/sign.c (revision 159d09a20817016f09b3ea28d1bdada4a336bb91)
1 /*
2  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 
7 /*
8  * Copyright 1993 by OpenVision Technologies, Inc.
9  *
10  * Permission to use, copy, modify, distribute, and sell this software
11  * and its documentation for any purpose is hereby granted without fee,
12  * provided that the above copyright notice appears in all copies and
13  * that both that copyright notice and this permission notice appear in
14  * supporting documentation, and that the name of OpenVision not be used
15  * in advertising or publicity pertaining to distribution of the software
16  * without specific, written prior permission. OpenVision makes no
17  * representations about the suitability of this software for any
18  * purpose.  It is provided "as is" without express or implied warranty.
19  *
20  * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
21  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
22  * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
23  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
24  * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26  * PERFORMANCE OF THIS SOFTWARE.
27  */
28 
29 #include "gssapiP_krb5.h"
30 
31 /*
32  * $Id: sign.c 16171 2004-03-15 17:45:01Z raeburn $
33  */
34 
35 /*ARGSUSED*/
36 OM_uint32
krb5_gss_sign(minor_status,context_handle,qop_req,message_buffer,message_token,gssd_ctx_verifier)37 krb5_gss_sign(minor_status, context_handle,
38 	      qop_req, message_buffer,
39 	      message_token
40 #ifdef	 _KERNEL
41 	    , gssd_ctx_verifier
42 #endif
43 	    )
44      OM_uint32 *minor_status;
45      gss_ctx_id_t context_handle;
46      int qop_req;
47      gss_buffer_t message_buffer;
48      gss_buffer_t message_token;
49 #ifdef	 _KERNEL
50      OM_uint32 gssd_ctx_verifier;
51 #endif
52 {
53    return(kg_seal(minor_status, context_handle, 0,
54 		  qop_req, message_buffer, NULL,
55 		  message_token, KG_TOK_SIGN_MSG));
56 }
57 
58 /* V2 interface */
59 OM_uint32
krb5_gss_get_mic(minor_status,context_handle,qop_req,message_buffer,message_token)60 krb5_gss_get_mic(minor_status, context_handle, qop_req,
61 		 message_buffer, message_token)
62     OM_uint32		*minor_status;
63     gss_ctx_id_t	context_handle;
64     gss_qop_t		qop_req;
65     gss_buffer_t	message_buffer;
66     gss_buffer_t	message_token;
67 {
68     return(kg_seal(minor_status, context_handle, 0,
69 		   (int) qop_req, message_buffer, NULL,
70 		   message_token, KG_TOK_MIC_MSG));
71 }
72