core cleanup: sipe-csta module is purple free
[siplcs.git] / src / core / sip-sec-mech.h
blobf34af3b48c12c59151fa54178c08decde8795a2e
1 /**
2 * @file sip-sec-mech.h
4 * pidgin-sipe
6 * Copyright (C) 2009 pier11 <pier11@operamail.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * Interface dependencies:
27 * <glib.h>
28 * "sip-sec.h"
31 /* Mechanism wrappers API (Inspired by GSS-API)
32 * All mechanisms should implement this API
34 * Current mechanisms are: Kerberos/GSS-API, sipe's NTLM and SSPI.
37 #define SIP_SEC_E_OK 0
38 #define SIP_SEC_E_INTERNAL_ERROR (-2146893052)
39 #define SIP_SEC_I_CONTINUE_NEEDED 590610
41 typedef unsigned long sip_uint32;
43 typedef struct {
44 gsize length;
45 guint8 *value;
46 } SipSecBuffer;
49 typedef SipSecContext
50 (*sip_sec_create_context_func)(SipSecAuthType type);
52 typedef sip_uint32
53 (*sip_sec_acquire_cred_func)(SipSecContext context,
54 const char *domain,
55 const char *username,
56 const char *password);
58 typedef sip_uint32
59 (*sip_sec_init_context_func)(SipSecContext context,
60 SipSecBuffer in_buff,
61 SipSecBuffer *out_buff,
62 const char *service_name);
64 typedef void
65 (*sip_sec_destroy_context_func)(SipSecContext context);
67 typedef sip_uint32
68 (*sip_sec_make_signature_func)(SipSecContext context,
69 const char *message,
70 SipSecBuffer *signature);
72 typedef sip_uint32
73 (*sip_sec_verify_signature_func)(SipSecContext context,
74 const char *message,
75 SipSecBuffer signature);
77 struct sip_sec_context {
78 sip_sec_acquire_cred_func acquire_cred_func;
79 sip_sec_init_context_func init_context_func;
80 sip_sec_destroy_context_func destroy_context_func;
81 sip_sec_make_signature_func make_signature_func;
82 sip_sec_verify_signature_func verify_signature_func;
83 /** Single Sign-On request flag 0=FALSE */
84 int sso;
85 /** Security Context expiration interval in seconds */
86 int expires;
87 /** 0 - FALSE; otherwise TRUE */
88 int is_connection_based;