mirror of
https://github.com/samba-team/samba.git
synced 2025-03-25 14:50:24 +03:00
s4:heimdal: import lorikeet-heimdal-201009250123 (commit 42cabfb5b683dbcb97d583c397b897507689e382)
I based this on Matthieu's import of lorikeet-heimdal, and then updated it to this commit. Andrew Bartlett
This commit is contained in:
parent
197a1514d6
commit
ab6e3fce04
@ -12,34 +12,33 @@ cooperation in the use of the heimdal code in Samba.
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 - 2005 Kungliga Tekniska Högskolan and others.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
@ -264,7 +264,7 @@ krb5_kdc_get_config(krb5_context context, krb5_kdc_configuration **config)
|
||||
|
||||
if (c->pkinit_kdc_identity == NULL) {
|
||||
if (c->pkinit_kdc_friendly_name == NULL)
|
||||
c->pkinit_kdc_friendly_name =
|
||||
c->pkinit_kdc_friendly_name =
|
||||
strdup("O=System Identity,CN=com.apple.kerberos.kdc");
|
||||
c->pkinit_kdc_identity = strdup("KEYCHAIN:");
|
||||
}
|
||||
@ -276,7 +276,7 @@ krb5_kdc_get_config(krb5_context context, krb5_kdc_configuration **config)
|
||||
if (c->enable_pkinit) {
|
||||
if (c->pkinit_kdc_identity == NULL)
|
||||
krb5_errx(context, 1, "pkinit enabled but no identity");
|
||||
|
||||
|
||||
if (c->pkinit_kdc_anchors == NULL)
|
||||
krb5_errx(context, 1, "pkinit enabled but no X509 anchors");
|
||||
|
||||
@ -287,7 +287,7 @@ krb5_kdc_get_config(krb5_context context, krb5_kdc_configuration **config)
|
||||
c->pkinit_kdc_revoke);
|
||||
|
||||
}
|
||||
|
||||
|
||||
*config = c;
|
||||
|
||||
return 0;
|
||||
|
@ -910,7 +910,7 @@ _kdc_as_rep(krb5_context context,
|
||||
const char *e_text = NULL;
|
||||
krb5_crypto crypto;
|
||||
Key *ckey, *skey;
|
||||
EncryptionKey *reply_key, session_key;
|
||||
EncryptionKey *reply_key = NULL, session_key;
|
||||
int flags = 0;
|
||||
#ifdef PKINIT
|
||||
pk_client_params *pkp = NULL;
|
||||
|
@ -314,6 +314,7 @@ check_PAC(krb5_context context,
|
||||
for (j = 0; j < child.len; j++) {
|
||||
|
||||
if (child.val[j].ad_type == KRB5_AUTHDATA_WIN2K_PAC) {
|
||||
int signed_pac = 0;
|
||||
krb5_pac pac;
|
||||
|
||||
/* Found PAC */
|
||||
@ -334,19 +335,26 @@ check_PAC(krb5_context context,
|
||||
}
|
||||
|
||||
ret = _kdc_pac_verify(context, client_principal,
|
||||
client, server, krbtgt, &pac);
|
||||
client, server, krbtgt, &pac, &signed_pac);
|
||||
if (ret) {
|
||||
krb5_pac_free(context, pac);
|
||||
return ret;
|
||||
}
|
||||
*signedpath = 1;
|
||||
|
||||
ret = _krb5_pac_sign(context, pac, tkt->authtime,
|
||||
client_principal,
|
||||
server_key, krbtgt_sign_key, rspac);
|
||||
|
||||
/*
|
||||
* Only re-sign PAC if we could verify it with the PAC
|
||||
* function. The no-verify case happens when we get in
|
||||
* a PAC from cross realm from a Windows domain and
|
||||
* that there is no PAC verification function.
|
||||
*/
|
||||
if (signed_pac) {
|
||||
*signedpath = 1;
|
||||
ret = _krb5_pac_sign(context, pac, tkt->authtime,
|
||||
client_principal,
|
||||
server_key, krbtgt_key, rspac);
|
||||
}
|
||||
krb5_pac_free(context, pac);
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@ -449,7 +457,7 @@ check_tgs_flags(krb5_context context,
|
||||
}
|
||||
|
||||
if(f.renewable){
|
||||
if(!tgt->flags.renewable){
|
||||
if(!tgt->flags.renewable || tgt->renew_till == NULL){
|
||||
kdc_log(context, config, 0,
|
||||
"Bad request for renewable ticket");
|
||||
return KRB5KDC_ERR_BADOPTION;
|
||||
@ -802,7 +810,9 @@ tgs_make_reply(krb5_context context,
|
||||
et.endtime = *et.starttime + life;
|
||||
}
|
||||
if(f.renewable_ok && tgt->flags.renewable &&
|
||||
et.renew_till == NULL && et.endtime < *b->till){
|
||||
et.renew_till == NULL && et.endtime < *b->till &&
|
||||
tgt->renew_till != NULL)
|
||||
{
|
||||
et.flags.renewable = 1;
|
||||
ALLOC(et.renew_till);
|
||||
*et.renew_till = *b->till;
|
||||
|
@ -227,10 +227,7 @@ generate_dh_keyblock(krb5_context context,
|
||||
goto out;
|
||||
}
|
||||
|
||||
dh_gen_keylen = DH_size(client_params->u.dh.key);
|
||||
size = BN_num_bytes(client_params->u.dh.key->p);
|
||||
if (size < dh_gen_keylen)
|
||||
size = dh_gen_keylen;
|
||||
size = DH_size(client_params->u.dh.key);
|
||||
|
||||
dh_gen_key = malloc(size);
|
||||
if (dh_gen_key == NULL) {
|
||||
@ -238,17 +235,20 @@ generate_dh_keyblock(krb5_context context,
|
||||
krb5_set_error_message(context, ret, "malloc: out of memory");
|
||||
goto out;
|
||||
}
|
||||
memset(dh_gen_key, 0, size - dh_gen_keylen);
|
||||
|
||||
dh_gen_keylen = DH_compute_key(dh_gen_key + (size - dh_gen_keylen),
|
||||
client_params->u.dh.public_key,
|
||||
client_params->u.dh.key);
|
||||
dh_gen_keylen = DH_compute_key(dh_gen_key,client_params->u.dh.public_key, client_params->u.dh.key);
|
||||
if (dh_gen_keylen == -1) {
|
||||
ret = KRB5KRB_ERR_GENERIC;
|
||||
krb5_set_error_message(context, ret,
|
||||
"Can't compute Diffie-Hellman key");
|
||||
goto out;
|
||||
}
|
||||
if (dh_gen_keylen < size) {
|
||||
size -= dh_gen_keylen;
|
||||
memmove(dh_gen_key + size, dh_gen_key, dh_gen_keylen);
|
||||
memset(dh_gen_key, 0, size);
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
#ifdef HAVE_OPENSSL
|
||||
} else if (client_params->keyex == USE_ECDH) {
|
||||
|
@ -87,14 +87,19 @@ _kdc_pac_verify(krb5_context context,
|
||||
hdb_entry_ex *client,
|
||||
hdb_entry_ex *server,
|
||||
hdb_entry_ex *krbtgt,
|
||||
krb5_pac *pac)
|
||||
krb5_pac *pac,
|
||||
int *verified)
|
||||
{
|
||||
if (windcft == NULL) {
|
||||
krb5_set_error_message(context, EINVAL, "Can't verify PAC, no function");
|
||||
return EINVAL;
|
||||
}
|
||||
return (windcft->pac_verify)(windcctx, context,
|
||||
client_principal, client, server, krbtgt, pac);
|
||||
krb5_error_code ret;
|
||||
|
||||
if (windcft == NULL)
|
||||
return 0;
|
||||
|
||||
ret = windcft->pac_verify(windcctx, context,
|
||||
client_principal, client, server, krbtgt, pac);
|
||||
if (ret == 0)
|
||||
*verified = 1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
|
@ -20,8 +20,8 @@ typedef struct heim_octet_string {
|
||||
|
||||
typedef char *heim_general_string;
|
||||
typedef char *heim_utf8_string;
|
||||
typedef char *heim_printable_string;
|
||||
typedef char *heim_ia5_string;
|
||||
typedef struct heim_octet_string heim_printable_string;
|
||||
typedef struct heim_octet_string heim_ia5_string;
|
||||
|
||||
typedef struct heim_bmp_string {
|
||||
size_t length;
|
||||
@ -64,4 +64,16 @@ typedef struct heim_octet_string heim_any_set;
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef ASN1_LIB
|
||||
#define ASN1EXP __declspec(dllimport)
|
||||
#else
|
||||
#define ASN1EXP
|
||||
#endif
|
||||
#define ASN1CALL __stdcall
|
||||
#else
|
||||
#define ASN1EXP
|
||||
#define ASN1CALL
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -46,7 +46,7 @@ static int
|
||||
doit(const char *fn)
|
||||
{
|
||||
char buf[2048];
|
||||
char *fnout;
|
||||
char *fnout = NULL;
|
||||
const char *bname;
|
||||
unsigned long line = 0;
|
||||
FILE *f, *fout;
|
||||
@ -62,8 +62,7 @@ doit(const char *fn)
|
||||
else
|
||||
bname = fn;
|
||||
|
||||
asprintf(&fnout, "%s.out", bname);
|
||||
if (fnout == NULL)
|
||||
if (asprintf(&fnout, "%s.out", bname) < 0 || fnout == NULL)
|
||||
errx(1, "malloc");
|
||||
|
||||
fout = fopen(fnout, "w");
|
||||
|
@ -3015,7 +3015,8 @@ static void fix_labels1(struct memhead *members, const char *prefix)
|
||||
if(members == NULL)
|
||||
return;
|
||||
ASN1_TAILQ_FOREACH(m, members, members) {
|
||||
asprintf(&m->label, "%s_%s", prefix, m->gen_name);
|
||||
if (asprintf(&m->label, "%s_%s", prefix, m->gen_name) < 0)
|
||||
errx(1, "malloc");
|
||||
if (m->label == NULL)
|
||||
errx(1, "malloc");
|
||||
if(m->type != NULL)
|
||||
@ -3032,9 +3033,8 @@ static void fix_labels2(Type *t, const char *prefix)
|
||||
static void
|
||||
fix_labels(Symbol *s)
|
||||
{
|
||||
char *p;
|
||||
asprintf(&p, "choice_%s", s->gen_name);
|
||||
if (p == NULL)
|
||||
char *p = NULL;
|
||||
if (asprintf(&p, "choice_%s", s->gen_name) < 0 || p == NULL)
|
||||
errx(1, "malloc");
|
||||
fix_labels2(s->type, p);
|
||||
free(p);
|
||||
|
@ -1007,7 +1007,8 @@ static void fix_labels1(struct memhead *members, const char *prefix)
|
||||
if(members == NULL)
|
||||
return;
|
||||
ASN1_TAILQ_FOREACH(m, members, members) {
|
||||
asprintf(&m->label, "%s_%s", prefix, m->gen_name);
|
||||
if (asprintf(&m->label, "%s_%s", prefix, m->gen_name) < 0)
|
||||
errx(1, "malloc");
|
||||
if (m->label == NULL)
|
||||
errx(1, "malloc");
|
||||
if(m->type != NULL)
|
||||
@ -1024,9 +1025,8 @@ static void fix_labels2(Type *t, const char *prefix)
|
||||
static void
|
||||
fix_labels(Symbol *s)
|
||||
{
|
||||
char *p;
|
||||
asprintf(&p, "choice_%s", s->gen_name);
|
||||
if (p == NULL)
|
||||
char *p = NULL;
|
||||
if (asprintf(&p, "choice_%s", s->gen_name) < 0 || p == NULL)
|
||||
errx(1, "malloc");
|
||||
fix_labels2(s->type, p);
|
||||
free(p);
|
||||
|
@ -1 +1,2 @@
|
||||
--decode-dce-ber
|
||||
--sequence=DigestAlgorithmIdentifiers
|
||||
|
@ -52,6 +52,20 @@ der_heim_octet_string_cmp(const heim_octet_string *p,
|
||||
return memcmp(p->data, q->data, p->length);
|
||||
}
|
||||
|
||||
int
|
||||
der_printable_string_cmp(const heim_printable_string *p,
|
||||
const heim_printable_string *q)
|
||||
{
|
||||
return der_heim_octet_string_cmp(p, q);
|
||||
}
|
||||
|
||||
int
|
||||
der_ia5_string_cmp(const heim_ia5_string *p,
|
||||
const heim_ia5_string *q)
|
||||
{
|
||||
return der_heim_octet_string_cmp(p, q);
|
||||
}
|
||||
|
||||
int
|
||||
der_heim_bit_string_cmp(const heim_bit_string *p,
|
||||
const heim_bit_string *q)
|
||||
|
@ -85,14 +85,20 @@ int
|
||||
der_copy_printable_string (const heim_printable_string *from,
|
||||
heim_printable_string *to)
|
||||
{
|
||||
return der_copy_general_string(from, to);
|
||||
to->length = from->length;
|
||||
to->data = malloc(to->length + 1);
|
||||
if(to->data == NULL)
|
||||
return ENOMEM;
|
||||
memcpy(to->data, from->data, to->length);
|
||||
((char *)to->data)[to->length] = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
der_copy_ia5_string (const heim_printable_string *from,
|
||||
heim_printable_string *to)
|
||||
der_copy_ia5_string (const heim_ia5_string *from,
|
||||
heim_ia5_string *to)
|
||||
{
|
||||
return der_copy_general_string(from, to);
|
||||
return der_copy_printable_string(from, to);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -79,15 +79,13 @@ der_free_utf8string (heim_utf8_string *str)
|
||||
void
|
||||
der_free_printable_string (heim_printable_string *str)
|
||||
{
|
||||
free(*str);
|
||||
*str = NULL;
|
||||
der_free_octet_string(str);
|
||||
}
|
||||
|
||||
void
|
||||
der_free_ia5_string (heim_ia5_string *str)
|
||||
{
|
||||
free(*str);
|
||||
*str = NULL;
|
||||
der_free_octet_string(str);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -167,17 +167,24 @@ der_get_utf8string (const unsigned char *p, size_t len,
|
||||
}
|
||||
|
||||
int
|
||||
der_get_printable_string (const unsigned char *p, size_t len,
|
||||
heim_printable_string *str, size_t *size)
|
||||
der_get_printable_string(const unsigned char *p, size_t len,
|
||||
heim_printable_string *str, size_t *size)
|
||||
{
|
||||
return der_get_general_string(p, len, str, size);
|
||||
str->length = len;
|
||||
str->data = malloc(len + 1);
|
||||
if (str->data == NULL)
|
||||
return ENOMEM;
|
||||
memcpy(str->data, p, len);
|
||||
((char *)str->data)[len] = '\0';
|
||||
if(size) *size = len;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
der_get_ia5_string (const unsigned char *p, size_t len,
|
||||
heim_ia5_string *str, size_t *size)
|
||||
der_get_ia5_string(const unsigned char *p, size_t len,
|
||||
heim_ia5_string *str, size_t *size)
|
||||
{
|
||||
return der_get_general_string(p, len, str, size);
|
||||
return der_get_printable_string(p, len, str, size);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -161,13 +161,13 @@ der_length_utf8string (const heim_utf8_string *data)
|
||||
size_t
|
||||
der_length_printable_string (const heim_printable_string *data)
|
||||
{
|
||||
return strlen(*data);
|
||||
return data->length;
|
||||
}
|
||||
|
||||
size_t
|
||||
der_length_ia5_string (const heim_ia5_string *data)
|
||||
{
|
||||
return strlen(*data);
|
||||
return data->length;
|
||||
}
|
||||
|
||||
size_t
|
||||
|
@ -181,14 +181,14 @@ int
|
||||
der_put_printable_string (unsigned char *p, size_t len,
|
||||
const heim_printable_string *str, size_t *size)
|
||||
{
|
||||
return der_put_general_string(p, len, str, size);
|
||||
return der_put_octet_string(p, len, str, size);
|
||||
}
|
||||
|
||||
int
|
||||
der_put_ia5_string (unsigned char *p, size_t len,
|
||||
const heim_ia5_string *str, size_t *size)
|
||||
{
|
||||
return der_put_general_string(p, len, str, size);
|
||||
return der_put_octet_string(p, len, str, size);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -116,7 +116,7 @@ get_filename (void)
|
||||
void
|
||||
init_generate (const char *filename, const char *base)
|
||||
{
|
||||
char *fn;
|
||||
char *fn = NULL;
|
||||
|
||||
orig_filename = filename;
|
||||
if (base != NULL) {
|
||||
@ -126,34 +126,30 @@ init_generate (const char *filename, const char *base)
|
||||
}
|
||||
|
||||
/* public header file */
|
||||
asprintf(&header, "%s.h", headerbase);
|
||||
if (header == NULL)
|
||||
if (asprintf(&header, "%s.h", headerbase) < 0 || header == NULL)
|
||||
errx(1, "malloc");
|
||||
asprintf(&fn, "%s.hx", headerbase);
|
||||
if (fn == NULL)
|
||||
if (asprintf(&fn, "%s.hx", headerbase) < 0 || fn == NULL)
|
||||
errx(1, "malloc");
|
||||
headerfile = fopen (fn, "w");
|
||||
if (headerfile == NULL)
|
||||
err (1, "open %s", fn);
|
||||
free(fn);
|
||||
fn = NULL;
|
||||
|
||||
/* private header file */
|
||||
asprintf(&privheader, "%s-priv.h", headerbase);
|
||||
if (privheader == NULL)
|
||||
if (asprintf(&privheader, "%s-priv.h", headerbase) < 0 || privheader == NULL)
|
||||
errx(1, "malloc");
|
||||
asprintf(&fn, "%s-priv.hx", headerbase);
|
||||
if (fn == NULL)
|
||||
if (asprintf(&fn, "%s-priv.hx", headerbase) < 0 || fn == NULL)
|
||||
errx(1, "malloc");
|
||||
privheaderfile = fopen (fn, "w");
|
||||
if (privheaderfile == NULL)
|
||||
err (1, "open %s", fn);
|
||||
free(fn);
|
||||
fn = NULL;
|
||||
|
||||
/* template file */
|
||||
asprintf(&template, "%s-template.c", headerbase);
|
||||
if (template == NULL)
|
||||
if (asprintf(&template, "%s-template.c", headerbase) < 0 || template == NULL)
|
||||
errx(1, "malloc");
|
||||
|
||||
fprintf (headerfile,
|
||||
"/* Generated from %s */\n"
|
||||
"/* Do not edit */\n\n",
|
||||
@ -185,10 +181,10 @@ init_generate (const char *filename, const char *base)
|
||||
"typedef char *heim_utf8_string;\n\n"
|
||||
);
|
||||
fprintf (headerfile,
|
||||
"typedef char *heim_printable_string;\n\n"
|
||||
"typedef struct heim_octet_string heim_printable_string;\n\n"
|
||||
);
|
||||
fprintf (headerfile,
|
||||
"typedef char *heim_ia5_string;\n\n"
|
||||
"typedef struct heim_octet_string heim_ia5_string;\n\n"
|
||||
);
|
||||
fprintf (headerfile,
|
||||
"typedef struct heim_bmp_string {\n"
|
||||
@ -232,10 +228,21 @@ init_generate (const char *filename, const char *base)
|
||||
" } \\\n"
|
||||
" } while (0)\n\n",
|
||||
headerfile);
|
||||
fputs("#ifdef _WIN32\n"
|
||||
"#ifndef ASN1_LIB\n"
|
||||
"#define ASN1EXP __declspec(dllimport)\n"
|
||||
"#else\n"
|
||||
"#define ASN1EXP\n"
|
||||
"#endif\n"
|
||||
"#define ASN1CALL __stdcall\n"
|
||||
"#else\n"
|
||||
"#define ASN1EXP\n"
|
||||
"#define ASN1CALL\n"
|
||||
"#endif\n",
|
||||
headerfile);
|
||||
fprintf (headerfile, "struct units;\n\n");
|
||||
fprintf (headerfile, "#endif\n\n");
|
||||
asprintf(&fn, "%s_files", base);
|
||||
if (fn == NULL)
|
||||
if (asprintf(&fn, "%s_files", base) < 0 || fn == NULL)
|
||||
errx(1, "malloc");
|
||||
logfile = fopen(fn, "w");
|
||||
if (logfile == NULL)
|
||||
@ -333,22 +340,23 @@ gen_compare_defval(const char *var, struct value *val)
|
||||
void
|
||||
generate_header_of_codefile(const char *name)
|
||||
{
|
||||
char *filename;
|
||||
char *filename = NULL;
|
||||
|
||||
if (codefile != NULL)
|
||||
abort();
|
||||
|
||||
asprintf (&filename, "%s_%s.x", STEM, name);
|
||||
if (filename == NULL)
|
||||
if (asprintf (&filename, "%s_%s.x", STEM, name) < 0 || filename == NULL)
|
||||
errx(1, "malloc");
|
||||
codefile = fopen (filename, "w");
|
||||
if (codefile == NULL)
|
||||
err (1, "fopen %s", filename);
|
||||
fprintf(logfile, "%s ", filename);
|
||||
free(filename);
|
||||
filename = NULL;
|
||||
fprintf (codefile,
|
||||
"/* Generated from %s */\n"
|
||||
"/* Do not edit */\n\n"
|
||||
"#define ASN1_LIB\n\n"
|
||||
"#include <stdio.h>\n"
|
||||
"#include <stdlib.h>\n"
|
||||
"#include <time.h>\n"
|
||||
@ -399,6 +407,7 @@ generate_constant (const Symbol *s)
|
||||
case objectidentifiervalue: {
|
||||
struct objid *o, **list;
|
||||
unsigned int i, len;
|
||||
char *gen_upper;
|
||||
|
||||
if (!one_code_file)
|
||||
generate_header_of_codefile(s->gen_name);
|
||||
@ -424,12 +433,6 @@ generate_constant (const Symbol *s)
|
||||
o->label ? o->label : "label-less", o->value);
|
||||
}
|
||||
|
||||
fprintf (headerfile, "} */\n");
|
||||
fprintf (headerfile,
|
||||
"extern const heim_oid asn1_oid_%s;\n\n",
|
||||
s->gen_name);
|
||||
|
||||
|
||||
fprintf (codefile, "static unsigned oid_%s_variable_num[%d] = {",
|
||||
s->gen_name, len);
|
||||
for (i = len ; i > 0; i--) {
|
||||
@ -443,6 +446,23 @@ generate_constant (const Symbol *s)
|
||||
|
||||
free(list);
|
||||
|
||||
/* header file */
|
||||
|
||||
gen_upper = strdup(s->gen_name);
|
||||
len = strlen(gen_upper);
|
||||
for (i = 0; i < len; i++)
|
||||
gen_upper[i] = toupper((int)s->gen_name[i]);
|
||||
|
||||
fprintf (headerfile, "} */\n");
|
||||
fprintf (headerfile,
|
||||
"extern ASN1EXP const heim_oid asn1_oid_%s;\n"
|
||||
"#define ASN1_OID_%s (&asn1_oid_%s)\n\n",
|
||||
s->gen_name,
|
||||
gen_upper,
|
||||
s->gen_name);
|
||||
|
||||
free(gen_upper);
|
||||
|
||||
if (!one_code_file)
|
||||
close_codefile();
|
||||
|
||||
@ -673,7 +693,8 @@ getnewbasename(char **newbasename, int typedefp, const char *basename, const cha
|
||||
else {
|
||||
if (name[0] == '*')
|
||||
name++;
|
||||
asprintf(newbasename, "%s_%s", basename, name);
|
||||
if (asprintf(newbasename, "%s_%s", basename, name) < 0)
|
||||
errx(1, "malloc");
|
||||
}
|
||||
if (*newbasename == NULL)
|
||||
err(1, "malloc");
|
||||
@ -739,27 +760,30 @@ define_type (int level, const char *name, const char *basename, Type *t, int typ
|
||||
|
||||
fprintf (headerfile, "struct %s {\n", newbasename);
|
||||
ASN1_TAILQ_FOREACH(m, t->members, members) {
|
||||
char *n;
|
||||
char *n = NULL;
|
||||
|
||||
/* pad unused */
|
||||
while (pos < m->val) {
|
||||
asprintf (&n, "_unused%d:1", pos);
|
||||
if (asprintf (&n, "_unused%d:1", pos) < 0 || n == NULL)
|
||||
errx(1, "malloc");
|
||||
define_type (level + 1, n, newbasename, &i, FALSE, FALSE);
|
||||
free(n);
|
||||
pos++;
|
||||
}
|
||||
|
||||
asprintf (&n, "%s:1", m->gen_name);
|
||||
if (n == NULL)
|
||||
n = NULL;
|
||||
if (asprintf (&n, "%s:1", m->gen_name) < 0 || n == NULL)
|
||||
errx(1, "malloc");
|
||||
define_type (level + 1, n, newbasename, &i, FALSE, FALSE);
|
||||
free (n);
|
||||
n = NULL;
|
||||
pos++;
|
||||
}
|
||||
/* pad to 32 elements */
|
||||
while (pos < 32) {
|
||||
char *n;
|
||||
asprintf (&n, "_unused%d:1", pos);
|
||||
char *n = NULL;
|
||||
if (asprintf (&n, "_unused%d:1", pos) < 0 || n == NULL)
|
||||
errx(1, "malloc");
|
||||
define_type (level + 1, n, newbasename, &i, FALSE, FALSE);
|
||||
free(n);
|
||||
pos++;
|
||||
@ -803,10 +827,9 @@ define_type (int level, const char *name, const char *basename, Type *t, int typ
|
||||
if (m->ellipsis) {
|
||||
;
|
||||
} else if (m->optional) {
|
||||
char *n;
|
||||
char *n = NULL;
|
||||
|
||||
asprintf (&n, "*%s", m->gen_name);
|
||||
if (n == NULL)
|
||||
if (asprintf (&n, "*%s", m->gen_name) < 0 || n == NULL)
|
||||
errx(1, "malloc");
|
||||
define_type (level + 1, n, newbasename, m->type, FALSE, FALSE);
|
||||
free (n);
|
||||
@ -891,10 +914,9 @@ define_type (int level, const char *name, const char *basename, Type *t, int typ
|
||||
space(level + 2);
|
||||
fprintf(headerfile, "heim_octet_string asn1_ellipsis;\n");
|
||||
} else if (m->optional) {
|
||||
char *n;
|
||||
char *n = NULL;
|
||||
|
||||
asprintf (&n, "*%s", m->gen_name);
|
||||
if (n == NULL)
|
||||
if (asprintf (&n, "*%s", m->gen_name) < 0 || n == NULL)
|
||||
errx(1, "malloc");
|
||||
define_type (level + 2, n, newbasename, m->type, FALSE, FALSE);
|
||||
free (n);
|
||||
@ -970,6 +992,7 @@ void
|
||||
generate_type (const Symbol *s)
|
||||
{
|
||||
FILE *h;
|
||||
const char * exp;
|
||||
|
||||
if (!one_code_file)
|
||||
generate_header_of_codefile(s->gen_name);
|
||||
@ -991,30 +1014,37 @@ generate_type (const Symbol *s)
|
||||
|
||||
/* generate prototypes */
|
||||
|
||||
if (is_export(s->name))
|
||||
if (is_export(s->name)) {
|
||||
h = headerfile;
|
||||
else
|
||||
exp = "ASN1EXP ";
|
||||
} else {
|
||||
h = privheaderfile;
|
||||
exp = "";
|
||||
}
|
||||
|
||||
fprintf (h,
|
||||
"int "
|
||||
"%sint ASN1CALL "
|
||||
"decode_%s(const unsigned char *, size_t, %s *, size_t *);\n",
|
||||
exp,
|
||||
s->gen_name, s->gen_name);
|
||||
fprintf (h,
|
||||
"int "
|
||||
"%sint ASN1CALL "
|
||||
"encode_%s(unsigned char *, size_t, const %s *, size_t *);\n",
|
||||
exp,
|
||||
s->gen_name, s->gen_name);
|
||||
fprintf (h,
|
||||
"size_t length_%s(const %s *);\n",
|
||||
"%ssize_t ASN1CALL length_%s(const %s *);\n",
|
||||
exp,
|
||||
s->gen_name, s->gen_name);
|
||||
fprintf (h,
|
||||
"int copy_%s (const %s *, %s *);\n",
|
||||
"%sint ASN1CALL copy_%s (const %s *, %s *);\n",
|
||||
exp,
|
||||
s->gen_name, s->gen_name, s->gen_name);
|
||||
fprintf (h,
|
||||
"void free_%s (%s *);\n",
|
||||
"%svoid ASN1CALL free_%s (%s *);\n",
|
||||
exp,
|
||||
s->gen_name, s->gen_name);
|
||||
|
||||
|
||||
fprintf(h, "\n\n");
|
||||
|
||||
if (!one_code_file) {
|
||||
|
@ -110,14 +110,16 @@ copy_type (const char *from, const char *to, const Type *t, int preserve)
|
||||
if(t->type == TChoice)
|
||||
fprintf(codefile, "case %s:\n", m->label);
|
||||
|
||||
asprintf (&fs, "%s(%s)->%s%s",
|
||||
m->optional ? "" : "&", from,
|
||||
t->type == TChoice ? "u." : "", m->gen_name);
|
||||
if (asprintf (&fs, "%s(%s)->%s%s",
|
||||
m->optional ? "" : "&", from,
|
||||
t->type == TChoice ? "u." : "", m->gen_name) < 0)
|
||||
errx(1, "malloc");
|
||||
if (fs == NULL)
|
||||
errx(1, "malloc");
|
||||
asprintf (&ts, "%s(%s)->%s%s",
|
||||
m->optional ? "" : "&", to,
|
||||
t->type == TChoice ? "u." : "", m->gen_name);
|
||||
if (asprintf (&ts, "%s(%s)->%s%s",
|
||||
m->optional ? "" : "&", to,
|
||||
t->type == TChoice ? "u." : "", m->gen_name) < 0)
|
||||
errx(1, "malloc");
|
||||
if (ts == NULL)
|
||||
errx(1, "malloc");
|
||||
if(m->optional){
|
||||
@ -155,8 +157,7 @@ copy_type (const char *from, const char *to, const Type *t, int preserve)
|
||||
}
|
||||
case TSetOf:
|
||||
case TSequenceOf: {
|
||||
char *f;
|
||||
char *T;
|
||||
char *f = NULL, *T = NULL;
|
||||
|
||||
fprintf (codefile, "if(((%s)->val = "
|
||||
"malloc((%s)->len * sizeof(*(%s)->val))) == NULL && (%s)->len != 0)\n",
|
||||
@ -166,10 +167,12 @@ copy_type (const char *from, const char *to, const Type *t, int preserve)
|
||||
fprintf(codefile,
|
||||
"for((%s)->len = 0; (%s)->len < (%s)->len; (%s)->len++){\n",
|
||||
to, to, from, to);
|
||||
asprintf(&f, "&(%s)->val[(%s)->len]", from, to);
|
||||
if (asprintf(&f, "&(%s)->val[(%s)->len]", from, to) < 0)
|
||||
errx(1, "malloc");
|
||||
if (f == NULL)
|
||||
errx(1, "malloc");
|
||||
asprintf(&T, "&(%s)->val[(%s)->len]", to, to);
|
||||
if (asprintf(&T, "&(%s)->val[(%s)->len]", to, to) < 0)
|
||||
errx(1, "malloc");
|
||||
if (T == NULL)
|
||||
errx(1, "malloc");
|
||||
copy_type(f, T, t->subtype, FALSE);
|
||||
@ -228,7 +231,7 @@ generate_type_copy (const Symbol *s)
|
||||
|
||||
used_fail = 0;
|
||||
|
||||
fprintf (codefile, "int\n"
|
||||
fprintf (codefile, "int ASN1CALL\n"
|
||||
"copy_%s(const %s *from, %s *to)\n"
|
||||
"{\n"
|
||||
"memset(to, 0, sizeof(*to));\n",
|
||||
|
@ -320,14 +320,13 @@ decode_type (const char *name, const Type *t, int optional,
|
||||
break;
|
||||
|
||||
ASN1_TAILQ_FOREACH(m, t->members, members) {
|
||||
char *s;
|
||||
char *s = NULL;
|
||||
|
||||
if (m->ellipsis)
|
||||
continue;
|
||||
|
||||
asprintf (&s, "%s(%s)->%s", m->optional ? "" : "&",
|
||||
name, m->gen_name);
|
||||
if (s == NULL)
|
||||
if (asprintf (&s, "%s(%s)->%s", m->optional ? "" : "&",
|
||||
name, m->gen_name) < 0 || s == NULL)
|
||||
errx(1, "malloc");
|
||||
decode_type (s, m->type, m->optional, forwstr, m->gen_name, NULL);
|
||||
free (s);
|
||||
@ -363,8 +362,7 @@ decode_type (const char *name, const Type *t, int optional,
|
||||
is_primitive_type(m->type->subtype->type) ? "PRIM" : "CONS",
|
||||
valuename(m->type->tag.tagclass, m->type->tag.tagvalue));
|
||||
|
||||
asprintf (&s, "%s(%s)->%s", m->optional ? "" : "&", name, m->gen_name);
|
||||
if (s == NULL)
|
||||
if (asprintf (&s, "%s(%s)->%s", m->optional ? "" : "&", name, m->gen_name) < 0 || s == NULL)
|
||||
errx(1, "malloc");
|
||||
if(m->optional)
|
||||
fprintf(codefile,
|
||||
@ -388,8 +386,7 @@ decode_type (const char *name, const Type *t, int optional,
|
||||
ASN1_TAILQ_FOREACH(m, t->members, members) {
|
||||
char *s;
|
||||
|
||||
asprintf (&s, "%s->%s", name, m->gen_name);
|
||||
if (s == NULL)
|
||||
if (asprintf (&s, "%s->%s", name, m->gen_name) < 0 || s == NULL)
|
||||
errx(1, "malloc");
|
||||
fprintf(codefile, "if((members & (1 << %d)) == 0)\n", memno);
|
||||
if(m->optional)
|
||||
@ -406,8 +403,8 @@ decode_type (const char *name, const Type *t, int optional,
|
||||
}
|
||||
case TSetOf:
|
||||
case TSequenceOf: {
|
||||
char *n;
|
||||
char *sname;
|
||||
char *n = NULL;
|
||||
char *sname = NULL;
|
||||
|
||||
fprintf (codefile,
|
||||
"{\n"
|
||||
@ -441,11 +438,9 @@ decode_type (const char *name, const Type *t, int optional,
|
||||
tmpstr, forwstr,
|
||||
name, tmpstr);
|
||||
|
||||
asprintf (&n, "&(%s)->val[(%s)->len]", name, name);
|
||||
if (n == NULL)
|
||||
if (asprintf (&n, "&(%s)->val[(%s)->len]", name, name) < 0 || n == NULL)
|
||||
errx(1, "malloc");
|
||||
asprintf (&sname, "%s_s_of", tmpstr);
|
||||
if (sname == NULL)
|
||||
if (asprintf (&sname, "%s_s_of", tmpstr) < 0 || sname == NULL)
|
||||
errx(1, "malloc");
|
||||
decode_type (n, t->subtype, 0, forwstr, sname, NULL);
|
||||
fprintf (codefile,
|
||||
@ -472,10 +467,11 @@ decode_type (const char *name, const Type *t, int optional,
|
||||
decode_primitive ("general_string", name, forwstr);
|
||||
break;
|
||||
case TTag:{
|
||||
char *tname, *typestring;
|
||||
char *tname = NULL, *typestring = NULL;
|
||||
char *ide = NULL;
|
||||
|
||||
asprintf(&typestring, "%s_type", tmpstr);
|
||||
if (asprintf(&typestring, "%s_type", tmpstr) < 0 || typestring == NULL)
|
||||
errx(1, "malloc");
|
||||
|
||||
fprintf(codefile,
|
||||
"{\n"
|
||||
@ -528,8 +524,7 @@ decode_type (const char *name, const Type *t, int optional,
|
||||
fprintf(codefile,
|
||||
"if (%s_datalen > len) { e = ASN1_OVERRUN; %s; }\n"
|
||||
"len = %s_datalen;\n", tmpstr, forwstr, tmpstr);
|
||||
asprintf (&tname, "%s_Tag", tmpstr);
|
||||
if (tname == NULL)
|
||||
if (asprintf (&tname, "%s_Tag", tmpstr) < 0 || tname == NULL)
|
||||
errx(1, "malloc");
|
||||
decode_type (name, t->subtype, 0, forwstr, tname, ide);
|
||||
if(support_ber)
|
||||
@ -568,7 +563,7 @@ decode_type (const char *name, const Type *t, int optional,
|
||||
|
||||
ASN1_TAILQ_FOREACH(m, t->members, members) {
|
||||
const Type *tt = m->type;
|
||||
char *s;
|
||||
char *s = NULL;
|
||||
Der_class cl;
|
||||
Der_type ty;
|
||||
unsigned tag;
|
||||
@ -586,9 +581,8 @@ decode_type (const char *name, const Type *t, int optional,
|
||||
classname(cl),
|
||||
ty ? "CONS" : "PRIM",
|
||||
valuename(cl, tag));
|
||||
asprintf (&s, "%s(%s)->u.%s", m->optional ? "" : "&",
|
||||
name, m->gen_name);
|
||||
if (s == NULL)
|
||||
if (asprintf (&s, "%s(%s)->u.%s", m->optional ? "" : "&",
|
||||
name, m->gen_name) < 0 || s == NULL)
|
||||
errx(1, "malloc");
|
||||
decode_type (s, m->type, m->optional, forwstr, m->gen_name, NULL);
|
||||
fprintf(codefile,
|
||||
@ -667,7 +661,7 @@ generate_type_decode (const Symbol *s)
|
||||
{
|
||||
int preserve = preserve_type(s->name) ? TRUE : FALSE;
|
||||
|
||||
fprintf (codefile, "int\n"
|
||||
fprintf (codefile, "int ASN1CALL\n"
|
||||
"decode_%s(const unsigned char *p,"
|
||||
" size_t len, %s *data, size_t *size)\n"
|
||||
"{\n",
|
||||
|
@ -259,13 +259,12 @@ encode_type (const char *name, const Type *t, const char *tmpstr)
|
||||
break;
|
||||
|
||||
ASN1_TAILQ_FOREACH_REVERSE(m, t->members, memhead, members) {
|
||||
char *s;
|
||||
char *s = NULL;
|
||||
|
||||
if (m->ellipsis)
|
||||
continue;
|
||||
|
||||
asprintf (&s, "%s(%s)->%s", m->optional ? "" : "&", name, m->gen_name);
|
||||
if (s == NULL)
|
||||
if (asprintf (&s, "%s(%s)->%s", m->optional ? "" : "&", name, m->gen_name) < 0 || s == NULL)
|
||||
errx(1, "malloc");
|
||||
fprintf(codefile, "/* %s */\n", m->name);
|
||||
if (m->optional)
|
||||
@ -289,8 +288,8 @@ encode_type (const char *name, const Type *t, const char *tmpstr)
|
||||
fprintf(codefile,
|
||||
"{\n"
|
||||
"struct heim_octet_string *val;\n"
|
||||
"size_t elen, totallen = 0;\n"
|
||||
"int eret;\n");
|
||||
"size_t elen = 0, totallen = 0;\n"
|
||||
"int eret = 0;\n");
|
||||
|
||||
fprintf(codefile,
|
||||
"if ((%s)->len > UINT_MAX/sizeof(val[0]))\n"
|
||||
@ -352,19 +351,17 @@ encode_type (const char *name, const Type *t, const char *tmpstr)
|
||||
break;
|
||||
}
|
||||
case TSequenceOf: {
|
||||
char *n;
|
||||
char *sname;
|
||||
char *sname = NULL;
|
||||
char *n = NULL;
|
||||
|
||||
fprintf (codefile,
|
||||
"for(i = (%s)->len - 1; i >= 0; --i) {\n"
|
||||
"size_t %s_for_oldret = ret;\n"
|
||||
"ret = 0;\n",
|
||||
name, tmpstr);
|
||||
asprintf (&n, "&(%s)->val[i]", name);
|
||||
if (n == NULL)
|
||||
if (asprintf (&n, "&(%s)->val[i]", name) < 0 || n == NULL)
|
||||
errx(1, "malloc");
|
||||
asprintf (&sname, "%s_S_Of", tmpstr);
|
||||
if (sname == NULL)
|
||||
if (asprintf (&sname, "%s_S_Of", tmpstr) < 0 || sname == NULL)
|
||||
errx(1, "malloc");
|
||||
encode_type (n, t->subtype, sname);
|
||||
fprintf (codefile,
|
||||
@ -388,10 +385,9 @@ encode_type (const char *name, const Type *t, const char *tmpstr)
|
||||
constructed = 0;
|
||||
break;
|
||||
case TTag: {
|
||||
char *tname;
|
||||
char *tname = NULL;
|
||||
int c;
|
||||
asprintf (&tname, "%s_tag", tmpstr);
|
||||
if (tname == NULL)
|
||||
if (asprintf (&tname, "%s_tag", tmpstr) < 0 || tname == NULL)
|
||||
errx(1, "malloc");
|
||||
c = encode_type (name, t->subtype, tname);
|
||||
fprintf (codefile,
|
||||
@ -405,20 +401,19 @@ encode_type (const char *name, const Type *t, const char *tmpstr)
|
||||
}
|
||||
case TChoice:{
|
||||
Member *m, *have_ellipsis = NULL;
|
||||
char *s;
|
||||
char *s = NULL;
|
||||
|
||||
if (t->members == NULL)
|
||||
break;
|
||||
|
||||
fprintf(codefile, "\n");
|
||||
|
||||
asprintf (&s, "(%s)", name);
|
||||
if (s == NULL)
|
||||
if (asprintf (&s, "(%s)", name) < 0 || s == NULL)
|
||||
errx(1, "malloc");
|
||||
fprintf(codefile, "switch(%s->element) {\n", s);
|
||||
|
||||
ASN1_TAILQ_FOREACH_REVERSE(m, t->members, memhead, members) {
|
||||
char *s2;
|
||||
char *s2 = NULL;
|
||||
|
||||
if (m->ellipsis) {
|
||||
have_ellipsis = m;
|
||||
@ -426,9 +421,8 @@ encode_type (const char *name, const Type *t, const char *tmpstr)
|
||||
}
|
||||
|
||||
fprintf (codefile, "case %s: {", m->label);
|
||||
asprintf(&s2, "%s(%s)->u.%s", m->optional ? "" : "&",
|
||||
s, m->gen_name);
|
||||
if (s2 == NULL)
|
||||
if (asprintf(&s2, "%s(%s)->u.%s", m->optional ? "" : "&",
|
||||
s, m->gen_name) < 0 || s2 == NULL)
|
||||
errx(1, "malloc");
|
||||
if (m->optional)
|
||||
fprintf (codefile, "if(%s) {\n", s2);
|
||||
@ -508,7 +502,7 @@ encode_type (const char *name, const Type *t, const char *tmpstr)
|
||||
void
|
||||
generate_type_encode (const Symbol *s)
|
||||
{
|
||||
fprintf (codefile, "int\n"
|
||||
fprintf (codefile, "int ASN1CALL\n"
|
||||
"encode_%s(unsigned char *p, size_t len,"
|
||||
" const %s *data, size_t *size)\n"
|
||||
"{\n",
|
||||
|
@ -93,10 +93,9 @@ free_type (const char *name, const Type *t, int preserve)
|
||||
|
||||
if(t->type == TChoice)
|
||||
fprintf(codefile, "case %s:\n", m->label);
|
||||
asprintf (&s, "%s(%s)->%s%s",
|
||||
m->optional ? "" : "&", name,
|
||||
t->type == TChoice ? "u." : "", m->gen_name);
|
||||
if (s == NULL)
|
||||
if (asprintf (&s, "%s(%s)->%s%s",
|
||||
m->optional ? "" : "&", name,
|
||||
t->type == TChoice ? "u." : "", m->gen_name) < 0 || s == NULL)
|
||||
errx(1, "malloc");
|
||||
if(m->optional)
|
||||
fprintf(codefile, "if(%s) {\n", s);
|
||||
@ -128,8 +127,7 @@ free_type (const char *name, const Type *t, int preserve)
|
||||
char *n;
|
||||
|
||||
fprintf (codefile, "while((%s)->len){\n", name);
|
||||
asprintf (&n, "&(%s)->val[(%s)->len-1]", name, name);
|
||||
if (n == NULL)
|
||||
if (asprintf (&n, "&(%s)->val[(%s)->len-1]", name, name) < 0 || n == NULL)
|
||||
errx(1, "malloc");
|
||||
free_type(n, t->subtype, FALSE);
|
||||
fprintf(codefile,
|
||||
@ -182,7 +180,7 @@ generate_type_free (const Symbol *s)
|
||||
{
|
||||
int preserve = preserve_type(s->name) ? TRUE : FALSE;
|
||||
|
||||
fprintf (codefile, "void\n"
|
||||
fprintf (codefile, "void ASN1CALL\n"
|
||||
"free_%s(%s *data)\n"
|
||||
"{\n",
|
||||
s->gen_name, s->gen_name);
|
||||
|
@ -103,7 +103,7 @@ generate_units (const Type *t, const char *gen_name)
|
||||
gen_name, gen_name);
|
||||
} else {
|
||||
fprintf (headerfile,
|
||||
"const struct units * asn1_%s_units(void);",
|
||||
"const struct units * asn1_%s_units(void);\n",
|
||||
gen_name);
|
||||
}
|
||||
|
||||
|
@ -149,10 +149,9 @@ length_type (const char *name, const Type *t,
|
||||
if(t->type == TChoice)
|
||||
fprintf(codefile, "case %s:\n", m->label);
|
||||
|
||||
asprintf (&s, "%s(%s)->%s%s",
|
||||
m->optional ? "" : "&", name,
|
||||
t->type == TChoice ? "u." : "", m->gen_name);
|
||||
if (s == NULL)
|
||||
if (asprintf (&s, "%s(%s)->%s%s",
|
||||
m->optional ? "" : "&", name,
|
||||
t->type == TChoice ? "u." : "", m->gen_name) < 0 || s == NULL)
|
||||
errx(1, "malloc");
|
||||
if (m->optional)
|
||||
fprintf (codefile, "if(%s)", s);
|
||||
@ -183,24 +182,22 @@ length_type (const char *name, const Type *t,
|
||||
}
|
||||
case TSetOf:
|
||||
case TSequenceOf: {
|
||||
char *n;
|
||||
char *sname;
|
||||
char *n = NULL;
|
||||
char *sname = NULL;
|
||||
|
||||
fprintf (codefile,
|
||||
"{\n"
|
||||
"int %s_oldret = %s;\n"
|
||||
"size_t %s_oldret = %s;\n"
|
||||
"int i;\n"
|
||||
"%s = 0;\n",
|
||||
tmpstr, variable, variable);
|
||||
|
||||
fprintf (codefile, "for(i = (%s)->len - 1; i >= 0; --i){\n", name);
|
||||
fprintf (codefile, "int %s_for_oldret = %s;\n"
|
||||
fprintf (codefile, "size_t %s_for_oldret = %s;\n"
|
||||
"%s = 0;\n", tmpstr, variable, variable);
|
||||
asprintf (&n, "&(%s)->val[i]", name);
|
||||
if (n == NULL)
|
||||
if (asprintf (&n, "&(%s)->val[i]", name) < 0 || n == NULL)
|
||||
errx(1, "malloc");
|
||||
asprintf (&sname, "%s_S_Of", tmpstr);
|
||||
if (sname == NULL)
|
||||
if (asprintf (&sname, "%s_S_Of", tmpstr) < 0 || sname == NULL)
|
||||
errx(1, "malloc");
|
||||
length_type(n, t->subtype, variable, sname);
|
||||
fprintf (codefile, "%s += %s_for_oldret;\n",
|
||||
@ -248,9 +245,8 @@ length_type (const char *name, const Type *t,
|
||||
fprintf (codefile, "/* NULL */\n");
|
||||
break;
|
||||
case TTag:{
|
||||
char *tname;
|
||||
asprintf(&tname, "%s_tag", tmpstr);
|
||||
if (tname == NULL)
|
||||
char *tname = NULL;
|
||||
if (asprintf(&tname, "%s_tag", tmpstr) < 0 || tname == NULL)
|
||||
errx(1, "malloc");
|
||||
length_type (name, t->subtype, variable, tname);
|
||||
fprintf (codefile, "ret += %lu + der_length_len (ret);\n",
|
||||
@ -271,7 +267,7 @@ void
|
||||
generate_type_length (const Symbol *s)
|
||||
{
|
||||
fprintf (codefile,
|
||||
"size_t\n"
|
||||
"size_t ASN1CALL\n"
|
||||
"length_%s(const %s *data)\n"
|
||||
"{\n"
|
||||
"size_t ret = 0;\n",
|
||||
|
@ -47,8 +47,8 @@ generate_type_seq (const Symbol *s)
|
||||
while(type->type == TTag)
|
||||
type = type->subtype;
|
||||
|
||||
if (type->type != TSequenceOf) {
|
||||
printf("%s not seq of %d\n", s->name, (int)type->type);
|
||||
if (type->type != TSequenceOf && type->type != TSetOf) {
|
||||
fprintf(stderr, "%s not seq of %d\n", s->name, (int)type->type);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -67,12 +67,12 @@ generate_type_seq (const Symbol *s)
|
||||
subname = type->subtype->symbol->gen_name;
|
||||
|
||||
fprintf (headerfile,
|
||||
"int add_%s (%s *, const %s *);\n"
|
||||
"int remove_%s (%s *, unsigned int);\n",
|
||||
"ASN1EXP int ASN1CALL add_%s (%s *, const %s *);\n"
|
||||
"ASN1EXP int ASN1CALL remove_%s (%s *, unsigned int);\n",
|
||||
s->gen_name, s->gen_name, subname,
|
||||
s->gen_name, s->gen_name);
|
||||
|
||||
fprintf (codefile, "int\n"
|
||||
fprintf (codefile, "int ASN1CALL\n"
|
||||
"add_%s(%s *data, const %s *element)\n"
|
||||
"{\n",
|
||||
s->gen_name, s->gen_name, subname);
|
||||
@ -93,7 +93,7 @@ generate_type_seq (const Symbol *s)
|
||||
|
||||
fprintf (codefile, "}\n\n");
|
||||
|
||||
fprintf (codefile, "int\n"
|
||||
fprintf (codefile, "int ASN1CALL\n"
|
||||
"remove_%s(%s *data, unsigned int element)\n"
|
||||
"{\n",
|
||||
s->gen_name, s->gen_name);
|
||||
|
@ -224,7 +224,8 @@ partial_offset(const char *basetype, const char *name, int need_offset)
|
||||
char *str;
|
||||
if (name == NULL || need_offset == 0)
|
||||
return strdup("0");
|
||||
asprintf(&str, "offsetof(struct %s, %s)", basetype, name);
|
||||
if (asprintf(&str, "offsetof(struct %s, %s)", basetype, name) < 0 || str == NULL)
|
||||
errx(1, "malloc");
|
||||
return str;
|
||||
}
|
||||
|
||||
@ -273,7 +274,8 @@ tlist_header(struct tlist *t, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
vasprintf(&t->header, fmt, ap);
|
||||
if (vasprintf(&t->header, fmt, ap) < 0 || t->header == NULL)
|
||||
errx(1, "malloc");
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
@ -389,7 +391,8 @@ add_line(struct templatehead *t, const char *fmt, ...)
|
||||
struct template *q = calloc(1, sizeof(*q));
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
vasprintf(&q->line, fmt, ap);
|
||||
if (vasprintf(&q->line, fmt, ap) < 0 || q->line == NULL)
|
||||
errx(1, "malloc");
|
||||
va_end(ap);
|
||||
ASN1_TAILQ_INSERT_TAIL(t, q, members);
|
||||
return q;
|
||||
@ -404,10 +407,11 @@ add_line_pointer(struct templatehead *t,
|
||||
{
|
||||
struct template *q;
|
||||
va_list ap;
|
||||
char *tt;
|
||||
char *tt = NULL;
|
||||
|
||||
va_start(ap, ttfmt);
|
||||
vasprintf(&tt, ttfmt, ap);
|
||||
if (vasprintf(&tt, ttfmt, ap) < 0 || tt == NULL)
|
||||
errx(1, "malloc");
|
||||
va_end(ap);
|
||||
|
||||
q = add_line(t, "{ %s, %s, asn1_%s }", tt, offset, ptr);
|
||||
@ -543,7 +547,7 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
|
||||
struct template *q;
|
||||
Member *m;
|
||||
size_t count = 0, i;
|
||||
char *bname;
|
||||
char *bname = NULL;
|
||||
FILE *f = get_code_file();
|
||||
|
||||
if (ASN1_TAILQ_EMPTY(t->members)) {
|
||||
@ -551,7 +555,8 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
|
||||
break;
|
||||
}
|
||||
|
||||
asprintf(&bname, "bmember_%s_%lu", name ? name : "", (unsigned long)t);
|
||||
if (asprintf(&bname, "bmember_%s_%lu", name ? name : "", (unsigned long)t) < 0 || bname == NULL)
|
||||
errx(1, "malloc");
|
||||
output_name(bname);
|
||||
|
||||
ASN1_TAILQ_FOREACH(m, t->members, members) {
|
||||
@ -583,15 +588,18 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
|
||||
Member *m;
|
||||
|
||||
ASN1_TAILQ_FOREACH(m, t->members, members) {
|
||||
char *newbasename;
|
||||
|
||||
char *newbasename = NULL;
|
||||
|
||||
if (m->ellipsis)
|
||||
continue;
|
||||
|
||||
if (name)
|
||||
asprintf(&newbasename, "%s_%s", basetype, name);
|
||||
else
|
||||
if (name) {
|
||||
if (asprintf(&newbasename, "%s_%s", basetype, name) < 0)
|
||||
errx(1, "malloc");
|
||||
} else
|
||||
newbasename = strdup(basetype);
|
||||
if (newbasename == NULL)
|
||||
errx(1, "malloc");
|
||||
|
||||
template_members(temp, newbasename, m->gen_name, m->type, m->optional, isstruct, 1);
|
||||
|
||||
@ -601,7 +609,7 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
|
||||
break;
|
||||
}
|
||||
case TTag: {
|
||||
char *tname, *elname;
|
||||
char *tname = NULL, *elname = NULL;
|
||||
const char *sename, *dupname;
|
||||
int subtype_is_struct = is_struct(t->subtype, isstruct);
|
||||
|
||||
@ -610,10 +618,12 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
|
||||
else
|
||||
sename = symbol_name(basetype, t->subtype);
|
||||
|
||||
asprintf(&tname, "tag_%s_%lu", name ? name : "", (unsigned long)t);
|
||||
if (asprintf(&tname, "tag_%s_%lu", name ? name : "", (unsigned long)t) < 0 || tname == NULL)
|
||||
errx(1, "malloc");
|
||||
output_name(tname);
|
||||
|
||||
asprintf(&elname, "%s_%s", basetype, tname);
|
||||
if (asprintf(&elname, "%s_%s", basetype, tname) < 0 || elname == NULL)
|
||||
errx(1, "malloc");
|
||||
|
||||
generate_template_type(elname, &dupname, NULL, sename, name,
|
||||
t->subtype, 0, subtype_is_struct, 0);
|
||||
@ -633,16 +643,17 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
|
||||
case TSetOf:
|
||||
case TSequenceOf: {
|
||||
const char *type, *tname, *dupname;
|
||||
char *sename, *elname;
|
||||
char *sename = NULL, *elname = NULL;
|
||||
int subtype_is_struct = is_struct(t->subtype, 0);
|
||||
|
||||
if (name && subtype_is_struct) {
|
||||
tname = "seofTstruct";
|
||||
asprintf(&sename, "%s_%s_val",
|
||||
basetype, name);
|
||||
if (asprintf(&sename, "%s_%s_val", basetype, name) < 0)
|
||||
errx(1, "malloc");
|
||||
} else if (subtype_is_struct) {
|
||||
tname = "seofTstruct";
|
||||
asprintf(&sename, "%s_val", symbol_name(basetype, t->subtype));
|
||||
if (asprintf(&sename, "%s_val", symbol_name(basetype, t->subtype)) < 0)
|
||||
errx(1, "malloc");
|
||||
} else {
|
||||
if (name)
|
||||
tname = name;
|
||||
@ -650,12 +661,15 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
|
||||
tname = "seofTstruct";
|
||||
sename = strdup(symbol_name(basetype, t->subtype));
|
||||
}
|
||||
if (sename == NULL)
|
||||
errx(1, "malloc");
|
||||
|
||||
if (t->type == TSetOf) type = "A1_OP_SETOF";
|
||||
else if (t->type == TSequenceOf) type = "A1_OP_SEQOF";
|
||||
else abort();
|
||||
|
||||
asprintf(&elname, "%s_%s_%lu", basetype, tname, (unsigned long)t);
|
||||
if (asprintf(&elname, "%s_%s_%lu", basetype, tname, (unsigned long)t) < 0 || elname == NULL)
|
||||
errx(1, "malloc");
|
||||
|
||||
generate_template_type(elname, &dupname, NULL, sename, NULL, t->subtype,
|
||||
0, subtype_is_struct, need_offset);
|
||||
@ -668,21 +682,22 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
|
||||
struct templatehead template = ASN1_TAILQ_HEAD_INITIALIZER(template);
|
||||
struct template *q;
|
||||
size_t count = 0, i;
|
||||
char *tname;
|
||||
char *tname = NULL;
|
||||
FILE *f = get_code_file();
|
||||
Member *m;
|
||||
int ellipsis = 0;
|
||||
char *e;
|
||||
|
||||
asprintf(&tname, "asn1_choice_%s_%s%x",
|
||||
basetype, name ? name : "", (unsigned int)(uintptr_t)t);
|
||||
if (asprintf(&tname, "asn1_choice_%s_%s%x",
|
||||
basetype, name ? name : "", (unsigned int)(uintptr_t)t) < 0 || tname == NULL)
|
||||
errx(1, "malloc");
|
||||
|
||||
ASN1_TAILQ_FOREACH(m, t->members, members) {
|
||||
const char *dupname;
|
||||
char *elname;
|
||||
char *newbasename;
|
||||
char *elname = NULL;
|
||||
char *newbasename = NULL;
|
||||
int subtype_is_struct;
|
||||
|
||||
|
||||
if (m->ellipsis) {
|
||||
ellipsis = 1;
|
||||
continue;
|
||||
@ -690,13 +705,19 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
|
||||
|
||||
subtype_is_struct = is_struct(m->type, 0);
|
||||
|
||||
asprintf(&elname, "%s_choice_%s", basetype, m->gen_name);
|
||||
if (asprintf(&elname, "%s_choice_%s", basetype, m->gen_name) < 0 || elname == NULL)
|
||||
errx(1, "malloc");
|
||||
|
||||
if (subtype_is_struct)
|
||||
asprintf(&newbasename, "%s_%s", basetype, m->gen_name);
|
||||
else
|
||||
if (subtype_is_struct) {
|
||||
if (asprintf(&newbasename, "%s_%s", basetype, m->gen_name) < 0)
|
||||
errx(1, "malloc");
|
||||
} else
|
||||
newbasename = strdup(basetype);
|
||||
|
||||
if (newbasename == NULL)
|
||||
errx(1, "malloc");
|
||||
|
||||
|
||||
generate_template_type(elname, &dupname, NULL,
|
||||
symbol_name(newbasename, m->type),
|
||||
NULL, m->type, 0, subtype_is_struct, 1);
|
||||
@ -710,10 +731,11 @@ template_members(struct templatehead *temp, const char *basetype, const char *na
|
||||
free(newbasename);
|
||||
}
|
||||
|
||||
e = NULL;
|
||||
if (ellipsis) {
|
||||
asprintf(&e, "offsetof(%s%s, u.asn1_ellipsis)", isstruct ? "struct " : "", basetype);
|
||||
} else
|
||||
e = NULL;
|
||||
if (asprintf(&e, "offsetof(%s%s, u.asn1_ellipsis)", isstruct ? "struct " : "", basetype) < 0 || e == NULL)
|
||||
errx(1, "malloc");
|
||||
}
|
||||
|
||||
ASN1_TAILQ_FOREACH(q, &template, members) {
|
||||
count++;
|
||||
|
@ -52,6 +52,9 @@ id-rsadsi-des-ede3-cbc OBJECT IDENTIFIER ::= { id-rsadsi-encalg 7 }
|
||||
id-secsig-sha-1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
|
||||
oiw(14) secsig(3) algorithm(2) 26 }
|
||||
|
||||
id-secsig-sha-1WithRSAEncryption OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
|
||||
oiw(14) secsig(3) algorithm(2) 29 }
|
||||
|
||||
id-nistAlgorithm OBJECT IDENTIFIER ::= {
|
||||
joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) 4 }
|
||||
|
||||
@ -241,6 +244,13 @@ DomainParameters ::= SEQUENCE {
|
||||
validationParms ValidationParms OPTIONAL -- ValidationParms
|
||||
}
|
||||
|
||||
-- As defined by PKCS3
|
||||
DHParameter ::= SEQUENCE {
|
||||
prime INTEGER, -- odd prime, p=jq +1
|
||||
base INTEGER, -- generator, g
|
||||
privateValueLength INTEGER OPTIONAL
|
||||
}
|
||||
|
||||
DHPublicKey ::= INTEGER
|
||||
|
||||
OtherName ::= SEQUENCE {
|
||||
|
@ -43,7 +43,7 @@
|
||||
struct et_list *_et_list = NULL;
|
||||
|
||||
|
||||
const char *
|
||||
KRB5_LIB_FUNCTION const char * KRB5_LIB_CALL
|
||||
error_message (long code)
|
||||
{
|
||||
static char msg[128];
|
||||
@ -61,18 +61,18 @@ error_message (long code)
|
||||
return msg;
|
||||
}
|
||||
|
||||
int
|
||||
KRB5_LIB_FUNCTION int KRB5_LIB_CALL
|
||||
init_error_table(const char **msgs, long base, int count)
|
||||
{
|
||||
initialize_error_table_r(&_et_list, msgs, count, base);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
static void KRB5_CALLCONV
|
||||
default_proc (const char *whoami, long code, const char *fmt, va_list args)
|
||||
__attribute__((__format__(__printf__, 3, 0)));
|
||||
|
||||
static void
|
||||
static void KRB5_CALLCONV
|
||||
default_proc (const char *whoami, long code, const char *fmt, va_list args)
|
||||
{
|
||||
if (whoami)
|
||||
@ -86,7 +86,7 @@ default_proc (const char *whoami, long code, const char *fmt, va_list args)
|
||||
|
||||
static errf com_err_hook = default_proc;
|
||||
|
||||
void
|
||||
KRB5_LIB_FUNCTION void KRB5_LIB_CALL
|
||||
com_err_va (const char *whoami,
|
||||
long code,
|
||||
const char *fmt,
|
||||
@ -95,7 +95,7 @@ com_err_va (const char *whoami,
|
||||
(*com_err_hook) (whoami, code, fmt, args);
|
||||
}
|
||||
|
||||
void
|
||||
KRB5_LIB_FUNCTION void KRB5_LIB_CALL
|
||||
com_err (const char *whoami,
|
||||
long code,
|
||||
const char *fmt,
|
||||
@ -107,7 +107,7 @@ com_err (const char *whoami,
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
errf
|
||||
KRB5_LIB_FUNCTION errf KRB5_LIB_CALL
|
||||
set_com_err_hook (errf new)
|
||||
{
|
||||
errf old = com_err_hook;
|
||||
@ -120,7 +120,7 @@ set_com_err_hook (errf new)
|
||||
return old;
|
||||
}
|
||||
|
||||
errf
|
||||
KRB5_LIB_FUNCTION errf KRB5_LIB_CALL
|
||||
reset_com_err_hook (void)
|
||||
{
|
||||
return set_com_err_hook(NULL);
|
||||
@ -134,7 +134,7 @@ static const char char_set[] =
|
||||
|
||||
static char buf[6];
|
||||
|
||||
const char *
|
||||
KRB5_LIB_FUNCTION const char * KRB5_LIB_CALL
|
||||
error_table_name(int num)
|
||||
{
|
||||
int ch;
|
||||
@ -156,7 +156,7 @@ error_table_name(int num)
|
||||
return(buf);
|
||||
}
|
||||
|
||||
void
|
||||
KRB5_LIB_FUNCTION void KRB5_LIB_CALL
|
||||
add_to_error_table(struct et_list *new_table)
|
||||
{
|
||||
struct et_list *et;
|
||||
|
@ -45,22 +45,52 @@
|
||||
#define __attribute__(X)
|
||||
#endif
|
||||
|
||||
typedef void (*errf) (const char *, long, const char *, va_list);
|
||||
#ifndef KRB5_LIB
|
||||
#ifndef KRB5_LIB_FUNCTION
|
||||
#if defined(_WIN32)
|
||||
#define KRB5_LIB_FUNCTION __declspec(dllimport)
|
||||
#define KRB5_LIB_CALL __stdcall
|
||||
#define KRB5_LIB_VARIABLE __declspec(dllimport)
|
||||
#else
|
||||
#define KRB5_LIB_FUNCTION
|
||||
#define KRB5_LIB_CALL
|
||||
#define KRB5_LIB_VARIABLE
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
const char * error_message (long);
|
||||
int init_error_table (const char**, long, int);
|
||||
#ifdef _WIN32
|
||||
#define KRB5_CALLCONV __stdcall
|
||||
#else
|
||||
#define KRB5_CALLCONV
|
||||
#endif
|
||||
|
||||
void com_err_va (const char *, long, const char *, va_list)
|
||||
typedef void (KRB5_CALLCONV *errf) (const char *, long, const char *, va_list);
|
||||
|
||||
KRB5_LIB_FUNCTION const char * KRB5_LIB_CALL
|
||||
error_message (long);
|
||||
|
||||
KRB5_LIB_FUNCTION int KRB5_LIB_CALL
|
||||
init_error_table (const char**, long, int);
|
||||
|
||||
KRB5_LIB_FUNCTION void KRB5_LIB_CALL
|
||||
com_err_va (const char *, long, const char *, va_list)
|
||||
__attribute__((format(printf, 3, 0)));
|
||||
|
||||
void com_err (const char *, long, const char *, ...)
|
||||
KRB5_LIB_FUNCTION void KRB5_LIB_CALL
|
||||
com_err (const char *, long, const char *, ...)
|
||||
__attribute__((format(printf, 3, 4)));
|
||||
|
||||
errf set_com_err_hook (errf);
|
||||
errf reset_com_err_hook (void);
|
||||
KRB5_LIB_FUNCTION errf KRB5_LIB_CALL
|
||||
set_com_err_hook (errf);
|
||||
|
||||
const char *error_table_name (int num);
|
||||
KRB5_LIB_FUNCTION errf KRB5_LIB_CALL
|
||||
reset_com_err_hook (void);
|
||||
|
||||
void add_to_error_table (struct et_list *new_table);
|
||||
KRB5_LIB_FUNCTION const char * KRB5_LIB_CALL
|
||||
error_table_name (int num);
|
||||
|
||||
KRB5_LIB_FUNCTION void KRB5_LIB_CALL
|
||||
add_to_error_table (struct et_list *new_table);
|
||||
|
||||
#endif /* __COM_ERR_H__ */
|
||||
|
@ -73,6 +73,12 @@
|
||||
#define GSSAPI_CPP_END
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define GSSAPI_CALLCONV __stdcall
|
||||
#else
|
||||
#define GSSAPI_CALLCONV
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Now define the three implementation-dependent types.
|
||||
*/
|
||||
@ -266,7 +272,8 @@ GSSAPI_CPP_START
|
||||
* GSS_C_NT_USER_NAME should be initialized to point
|
||||
* to that gss_OID_desc.
|
||||
*/
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_USER_NAME;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_user_name_oid_desc;
|
||||
#define GSS_C_NT_USER_NAME (&__gss_c_nt_user_name_oid_desc)
|
||||
|
||||
/*
|
||||
* The implementation must reserve static storage for a
|
||||
@ -279,7 +286,8 @@ extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_USER_NAME;
|
||||
* The constant GSS_C_NT_MACHINE_UID_NAME should be
|
||||
* initialized to point to that gss_OID_desc.
|
||||
*/
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_MACHINE_UID_NAME;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_machine_uid_name_oid_desc;
|
||||
#define GSS_C_NT_MACHINE_UID_NAME (&__gss_c_nt_machine_uid_name_oid_desc)
|
||||
|
||||
/*
|
||||
* The implementation must reserve static storage for a
|
||||
@ -292,7 +300,8 @@ extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_MACHINE_UID_NAME;
|
||||
* The constant GSS_C_NT_STRING_UID_NAME should be
|
||||
* initialized to point to that gss_OID_desc.
|
||||
*/
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_STRING_UID_NAME;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_string_uid_name_oid_desc;
|
||||
#define GSS_C_NT_STRING_UID_NAME (&__gss_c_nt_string_uid_name_oid_desc)
|
||||
|
||||
/*
|
||||
* The implementation must reserve static storage for a
|
||||
@ -311,7 +320,8 @@ extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_STRING_UID_NAME;
|
||||
* parameter, but should not be emitted by GSS-API
|
||||
* implementations
|
||||
*/
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_hostbased_service_x_oid_desc;
|
||||
#define GSS_C_NT_HOSTBASED_SERVICE_X (&__gss_c_nt_hostbased_service_x_oid_desc)
|
||||
|
||||
/*
|
||||
* The implementation must reserve static storage for a
|
||||
@ -324,7 +334,8 @@ extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
|
||||
* GSS_C_NT_HOSTBASED_SERVICE should be initialized
|
||||
* to point to that gss_OID_desc.
|
||||
*/
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_HOSTBASED_SERVICE;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_hostbased_service_oid_desc;
|
||||
#define GSS_C_NT_HOSTBASED_SERVICE (&__gss_c_nt_hostbased_service_oid_desc)
|
||||
|
||||
/*
|
||||
* The implementation must reserve static storage for a
|
||||
@ -336,7 +347,8 @@ extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_HOSTBASED_SERVICE;
|
||||
* and GSS_C_NT_ANONYMOUS should be initialized to point
|
||||
* to that gss_OID_desc.
|
||||
*/
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_ANONYMOUS;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_anonymous_oid_desc;
|
||||
#define GSS_C_NT_ANONYMOUS (&__gss_c_nt_anonymous_oid_desc)
|
||||
|
||||
/*
|
||||
* The implementation must reserve static storage for a
|
||||
@ -348,13 +360,16 @@ extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_ANONYMOUS;
|
||||
* GSS_C_NT_EXPORT_NAME should be initialized to point
|
||||
* to that gss_OID_desc.
|
||||
*/
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_NT_EXPORT_NAME;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_nt_export_name_oid_desc;
|
||||
#define GSS_C_NT_EXPORT_NAME (&__gss_c_nt_export_name_oid_desc)
|
||||
|
||||
/*
|
||||
* Digest mechanism
|
||||
*/
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_SASL_DIGEST_MD5_MECHANISM;
|
||||
extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_sasl_digest_md5_mechanism_oid_desc;
|
||||
#define GSS_SASL_DIGEST_MD5_MECHANISM (&__gss_sasl_digest_md5_mechanism_oid_desc)
|
||||
|
||||
|
||||
/* Major status codes */
|
||||
|
||||
@ -437,7 +452,7 @@ extern GSSAPI_LIB_VARIABLE gss_OID GSS_SASL_DIGEST_MD5_MECHANISM;
|
||||
* Finally, function prototypes for the GSS-API routines.
|
||||
*/
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_acquire_cred
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_acquire_cred
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
const gss_name_t /*desired_name*/,
|
||||
OM_uint32 /*time_req*/,
|
||||
@ -448,12 +463,12 @@ OM_uint32 GSSAPI_LIB_FUNCTION gss_acquire_cred
|
||||
OM_uint32 * /*time_rec*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_release_cred
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_release_cred
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
gss_cred_id_t * /*cred_handle*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_init_sec_context
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_init_sec_context
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
const gss_cred_id_t /*initiator_cred_handle*/,
|
||||
gss_ctx_id_t * /*context_handle*/,
|
||||
@ -469,7 +484,7 @@ OM_uint32 GSSAPI_LIB_FUNCTION gss_init_sec_context
|
||||
OM_uint32 * /*time_rec*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_accept_sec_context
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_accept_sec_context
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
gss_ctx_id_t * /*context_handle*/,
|
||||
const gss_cred_id_t /*acceptor_cred_handle*/,
|
||||
@ -483,25 +498,25 @@ OM_uint32 GSSAPI_LIB_FUNCTION gss_accept_sec_context
|
||||
gss_cred_id_t * /*delegated_cred_handle*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_process_context_token
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_process_context_token
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
const gss_ctx_id_t /*context_handle*/,
|
||||
const gss_buffer_t /*token_buffer*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_delete_sec_context
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_delete_sec_context
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
gss_ctx_id_t * /*context_handle*/,
|
||||
gss_buffer_t /*output_token*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_context_time
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_context_time
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
const gss_ctx_id_t /*context_handle*/,
|
||||
OM_uint32 * /*time_rec*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_get_mic
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_get_mic
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
const gss_ctx_id_t /*context_handle*/,
|
||||
gss_qop_t /*qop_req*/,
|
||||
@ -509,7 +524,7 @@ OM_uint32 GSSAPI_LIB_FUNCTION gss_get_mic
|
||||
gss_buffer_t /*message_token*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_verify_mic
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_verify_mic
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
const gss_ctx_id_t /*context_handle*/,
|
||||
const gss_buffer_t /*message_buffer*/,
|
||||
@ -517,7 +532,7 @@ OM_uint32 GSSAPI_LIB_FUNCTION gss_verify_mic
|
||||
gss_qop_t * /*qop_state*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_wrap
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_wrap
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
const gss_ctx_id_t /*context_handle*/,
|
||||
int /*conf_req_flag*/,
|
||||
@ -527,7 +542,7 @@ OM_uint32 GSSAPI_LIB_FUNCTION gss_wrap
|
||||
gss_buffer_t /*output_message_buffer*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_unwrap
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_unwrap
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
const gss_ctx_id_t /*context_handle*/,
|
||||
const gss_buffer_t /*input_message_buffer*/,
|
||||
@ -536,7 +551,7 @@ OM_uint32 GSSAPI_LIB_FUNCTION gss_unwrap
|
||||
gss_qop_t * /*qop_state*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_display_status
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_display_status
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
OM_uint32 /*status_value*/,
|
||||
int /*status_type*/,
|
||||
@ -545,54 +560,54 @@ OM_uint32 GSSAPI_LIB_FUNCTION gss_display_status
|
||||
gss_buffer_t /*status_string*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_indicate_mechs
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_indicate_mechs
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
gss_OID_set * /*mech_set*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_compare_name
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_compare_name
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
const gss_name_t /*name1*/,
|
||||
const gss_name_t /*name2*/,
|
||||
int * /*name_equal*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_display_name
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_display_name
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
const gss_name_t /*input_name*/,
|
||||
gss_buffer_t /*output_name_buffer*/,
|
||||
gss_OID * /*output_name_type*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_import_name
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_import_name
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
const gss_buffer_t /*input_name_buffer*/,
|
||||
const gss_OID /*input_name_type*/,
|
||||
gss_name_t * /*output_name*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_export_name
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_export_name
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
const gss_name_t /*input_name*/,
|
||||
gss_buffer_t /*exported_name*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_release_name
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_release_name
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
gss_name_t * /*input_name*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_release_buffer
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_release_buffer
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
gss_buffer_t /*buffer*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_release_oid_set
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_release_oid_set
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
gss_OID_set * /*set*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_inquire_cred
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_inquire_cred
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
const gss_cred_id_t /*cred_handle*/,
|
||||
gss_name_t * /*name*/,
|
||||
@ -601,7 +616,7 @@ OM_uint32 GSSAPI_LIB_FUNCTION gss_inquire_cred
|
||||
gss_OID_set * /*mechanisms*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_inquire_context (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_inquire_context (
|
||||
OM_uint32 * /*minor_status*/,
|
||||
const gss_ctx_id_t /*context_handle*/,
|
||||
gss_name_t * /*src_name*/,
|
||||
@ -613,7 +628,7 @@ OM_uint32 GSSAPI_LIB_FUNCTION gss_inquire_context (
|
||||
int * /*open_context*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_wrap_size_limit (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_wrap_size_limit (
|
||||
OM_uint32 * /*minor_status*/,
|
||||
const gss_ctx_id_t /*context_handle*/,
|
||||
int /*conf_req_flag*/,
|
||||
@ -622,7 +637,7 @@ OM_uint32 GSSAPI_LIB_FUNCTION gss_wrap_size_limit (
|
||||
OM_uint32 * /*max_input_size*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_add_cred (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_add_cred (
|
||||
OM_uint32 * /*minor_status*/,
|
||||
const gss_cred_id_t /*input_cred_handle*/,
|
||||
const gss_name_t /*desired_name*/,
|
||||
@ -636,7 +651,7 @@ OM_uint32 GSSAPI_LIB_FUNCTION gss_add_cred (
|
||||
OM_uint32 * /*acceptor_time_rec*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_inquire_cred_by_mech (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_inquire_cred_by_mech (
|
||||
OM_uint32 * /*minor_status*/,
|
||||
const gss_cred_id_t /*cred_handle*/,
|
||||
const gss_OID /*mech_type*/,
|
||||
@ -646,81 +661,81 @@ OM_uint32 GSSAPI_LIB_FUNCTION gss_inquire_cred_by_mech (
|
||||
gss_cred_usage_t * /*cred_usage*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_export_sec_context (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_export_sec_context (
|
||||
OM_uint32 * /*minor_status*/,
|
||||
gss_ctx_id_t * /*context_handle*/,
|
||||
gss_buffer_t /*interprocess_token*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_import_sec_context (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_import_sec_context (
|
||||
OM_uint32 * /*minor_status*/,
|
||||
const gss_buffer_t /*interprocess_token*/,
|
||||
gss_ctx_id_t * /*context_handle*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_create_empty_oid_set (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_create_empty_oid_set (
|
||||
OM_uint32 * /*minor_status*/,
|
||||
gss_OID_set * /*oid_set*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_add_oid_set_member (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_add_oid_set_member (
|
||||
OM_uint32 * /*minor_status*/,
|
||||
const gss_OID /*member_oid*/,
|
||||
gss_OID_set * /*oid_set*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_test_oid_set_member (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_test_oid_set_member (
|
||||
OM_uint32 * /*minor_status*/,
|
||||
const gss_OID /*member*/,
|
||||
const gss_OID_set /*set*/,
|
||||
int * /*present*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_inquire_names_for_mech (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_inquire_names_for_mech (
|
||||
OM_uint32 * /*minor_status*/,
|
||||
const gss_OID /*mechanism*/,
|
||||
gss_OID_set * /*name_types*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_inquire_mechs_for_name (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_inquire_mechs_for_name (
|
||||
OM_uint32 * /*minor_status*/,
|
||||
const gss_name_t /*input_name*/,
|
||||
gss_OID_set * /*mech_types*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_canonicalize_name (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_canonicalize_name (
|
||||
OM_uint32 * /*minor_status*/,
|
||||
const gss_name_t /*input_name*/,
|
||||
const gss_OID /*mech_type*/,
|
||||
gss_name_t * /*output_name*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_duplicate_name (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_duplicate_name (
|
||||
OM_uint32 * /*minor_status*/,
|
||||
const gss_name_t /*src_name*/,
|
||||
gss_name_t * /*dest_name*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_duplicate_oid (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_duplicate_oid (
|
||||
OM_uint32 * /* minor_status */,
|
||||
gss_OID /* src_oid */,
|
||||
gss_OID * /* dest_oid */
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_release_oid
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
gss_OID * /* oid */
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_oid_to_str(
|
||||
OM_uint32 * /*minor_status*/,
|
||||
gss_OID /* oid */,
|
||||
gss_buffer_t /* str */
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_inquire_sec_context_by_oid(
|
||||
OM_uint32 * minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
@ -728,38 +743,38 @@ gss_inquire_sec_context_by_oid(
|
||||
gss_buffer_set_t *data_set
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_set_sec_context_option (OM_uint32 *minor_status,
|
||||
gss_ctx_id_t *context_handle,
|
||||
const gss_OID desired_object,
|
||||
const gss_buffer_t value);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_set_cred_option (OM_uint32 *minor_status,
|
||||
gss_cred_id_t *cred_handle,
|
||||
const gss_OID object,
|
||||
const gss_buffer_t value);
|
||||
|
||||
int GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION int GSSAPI_LIB_CALL
|
||||
gss_oid_equal(const gss_OID a, const gss_OID b);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_create_empty_buffer_set
|
||||
(OM_uint32 * minor_status,
|
||||
gss_buffer_set_t *buffer_set);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_add_buffer_set_member
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_buffer_t member_buffer,
|
||||
gss_buffer_set_t *buffer_set);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_release_buffer_set
|
||||
(OM_uint32 * minor_status,
|
||||
gss_buffer_set_t *buffer_set);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_inquire_cred_by_oid(OM_uint32 *minor_status,
|
||||
const gss_cred_id_t cred_handle,
|
||||
const gss_OID desired_object,
|
||||
@ -772,7 +787,7 @@ gss_inquire_cred_by_oid(OM_uint32 *minor_status,
|
||||
#define GSS_C_PRF_KEY_FULL 0
|
||||
#define GSS_C_PRF_KEY_PARTIAL 1
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_pseudo_random
|
||||
(OM_uint32 *minor_status,
|
||||
gss_ctx_id_t context,
|
||||
@ -782,7 +797,7 @@ gss_pseudo_random
|
||||
gss_buffer_t prf_out
|
||||
);
|
||||
|
||||
OM_uint32
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_store_cred(OM_uint32 * /* minor_status */,
|
||||
gss_cred_id_t /* input_cred_handle */,
|
||||
gss_cred_usage_t /* cred_usage */,
|
||||
@ -807,10 +822,11 @@ typedef struct {
|
||||
(GSS_IOV_BUFFER_TYPE_PADDING) */
|
||||
} gss_context_stream_sizes;
|
||||
|
||||
extern gss_OID GSSAPI_LIB_VARIABLE GSS_C_ATTR_STREAM_SIZES;
|
||||
extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_attr_stream_sizes_oid_desc;
|
||||
#define GSS_C_ATTR_STREAM_SIZES (&__gss_c_attr_stream_sizes_oid_desc)
|
||||
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_context_query_attributes(OM_uint32 * /* minor_status */,
|
||||
const gss_ctx_id_t /* context_handle */,
|
||||
const gss_OID /* attribute */,
|
||||
@ -827,7 +843,7 @@ gss_context_query_attributes(OM_uint32 * /* minor_status */,
|
||||
* obsolete versions of these routines and their current forms.
|
||||
*/
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION GSSAPI_DEPRECATED gss_sign
|
||||
GSSAPI_DEPRECATED GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_sign
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
gss_ctx_id_t /*context_handle*/,
|
||||
int /*qop_req*/,
|
||||
@ -835,7 +851,7 @@ OM_uint32 GSSAPI_LIB_FUNCTION GSSAPI_DEPRECATED gss_sign
|
||||
gss_buffer_t /*message_token*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION GSSAPI_DEPRECATED gss_verify
|
||||
GSSAPI_DEPRECATED GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_verify
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
gss_ctx_id_t /*context_handle*/,
|
||||
gss_buffer_t /*message_buffer*/,
|
||||
@ -843,7 +859,7 @@ OM_uint32 GSSAPI_LIB_FUNCTION GSSAPI_DEPRECATED gss_verify
|
||||
int * /*qop_state*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION GSSAPI_DEPRECATED gss_seal
|
||||
GSSAPI_DEPRECATED GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_seal
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
gss_ctx_id_t /*context_handle*/,
|
||||
int /*conf_req_flag*/,
|
||||
@ -853,7 +869,7 @@ OM_uint32 GSSAPI_LIB_FUNCTION GSSAPI_DEPRECATED gss_seal
|
||||
gss_buffer_t /*output_message_buffer*/
|
||||
);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION GSSAPI_DEPRECATED gss_unseal
|
||||
GSSAPI_DEPRECATED GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_unseal
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
gss_ctx_id_t /*context_handle*/,
|
||||
gss_buffer_t /*input_message_buffer*/,
|
||||
@ -866,12 +882,12 @@ OM_uint32 GSSAPI_LIB_FUNCTION GSSAPI_DEPRECATED gss_unseal
|
||||
*
|
||||
*/
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_encapsulate_token(const gss_buffer_t /* input_token */,
|
||||
const gss_OID /* oid */,
|
||||
gss_buffer_t /* output_token */);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_decapsulate_token(const gss_buffer_t /* input_token */,
|
||||
const gss_OID /* oid */,
|
||||
gss_buffer_t /* output_token */);
|
||||
@ -886,29 +902,29 @@ gss_decapsulate_token(const gss_buffer_t /* input_token */,
|
||||
* GSS_IOV
|
||||
*/
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_wrap_iov(OM_uint32 *, gss_ctx_id_t, int, gss_qop_t, int *,
|
||||
gss_iov_buffer_desc *, int);
|
||||
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_unwrap_iov(OM_uint32 *, gss_ctx_id_t, int *, gss_qop_t *,
|
||||
gss_iov_buffer_desc *, int);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_wrap_iov_length(OM_uint32 *, gss_ctx_id_t, int, gss_qop_t, int *,
|
||||
gss_iov_buffer_desc *, int);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_release_iov_buffer(OM_uint32 *, gss_iov_buffer_desc *, int);
|
||||
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_export_cred(OM_uint32 * /* minor_status */,
|
||||
gss_cred_id_t /* cred_handle */,
|
||||
gss_buffer_t /* cred_token */);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_import_cred(OM_uint32 * /* minor_status */,
|
||||
gss_buffer_t /* cred_token */,
|
||||
gss_cred_id_t * /* cred_handle */);
|
||||
|
@ -53,12 +53,15 @@ GSSAPI_CPP_START
|
||||
* This is for kerberos5 names.
|
||||
*/
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_NT_PRINCIPAL_NAME;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_NT_USER_NAME;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_NT_MACHINE_UID_NAME;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_NT_STRING_UID_NAME;
|
||||
extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_nt_principal_name_oid_desc;
|
||||
#define GSS_KRB5_NT_PRINCIPAL_NAME (&__gss_krb5_nt_principal_name_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_MECHANISM;
|
||||
#define GSS_KRB5_NT_USER_NAME (&__gss_c_nt_user_name_oid_desc)
|
||||
#define GSS_KRB5_NT_MACHINE_UID_NAME (&__gss_c_nt_machine_uid_name_oid_desc)
|
||||
#define GSS_KRB5_NT_STRING_UID_NAME (&__gss_c_nt_string_uid_name_oid_desc)
|
||||
|
||||
extern gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_mechanism_oid_desc;
|
||||
#define GSS_KRB5_MECHANISM (&__gss_krb5_mechanism_oid_desc)
|
||||
|
||||
/* for compatibility with MIT api */
|
||||
|
||||
@ -66,31 +69,77 @@ extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_MECHANISM;
|
||||
#define gss_krb5_nt_general_name GSS_KRB5_NT_PRINCIPAL_NAME
|
||||
|
||||
/* Extensions set contexts options */
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_COPY_CCACHE_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_COMPAT_DES3_MIC_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_REGISTER_ACCEPTOR_IDENTITY_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_SET_DNS_CANONICALIZE_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_SEND_TO_KDC_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_SET_DEFAULT_REALM_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_CCACHE_NAME_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_SET_TIME_OFFSET_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_GET_TIME_OFFSET_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_PLUGIN_REGISTER_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_copy_ccache_x_oid_desc;
|
||||
#define GSS_KRB5_COPY_CCACHE_X (&__gss_krb5_copy_ccache_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_compat_des3_mic_x_oid_desc;
|
||||
#define GSS_KRB5_COMPAT_DES3_MIC_X (&__gss_krb5_compat_des3_mic_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_register_acceptor_identity_x_oid_desc;
|
||||
#define GSS_KRB5_REGISTER_ACCEPTOR_IDENTITY_X (&__gss_krb5_register_acceptor_identity_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_set_dns_canonicalize_x_oid_desc;
|
||||
#define GSS_KRB5_SET_DNS_CANONICALIZE_X (&__gss_krb5_set_dns_canonicalize_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_send_to_kdc_x_oid_desc;
|
||||
#define GSS_KRB5_SEND_TO_KDC_X (&__gss_krb5_send_to_kdc_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_set_default_realm_x_oid_desc;
|
||||
#define GSS_KRB5_SET_DEFAULT_REALM_X (&__gss_krb5_set_default_realm_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_ccache_name_x_oid_desc;
|
||||
#define GSS_KRB5_CCACHE_NAME_X (&__gss_krb5_ccache_name_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_set_time_offset_x_oid_desc;
|
||||
#define GSS_KRB5_SET_TIME_OFFSET_X (&__gss_krb5_set_time_offset_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_get_time_offset_x_oid_desc;
|
||||
#define GSS_KRB5_GET_TIME_OFFSET_X (&__gss_krb5_get_time_offset_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_plugin_register_x_oid_desc;
|
||||
#define GSS_KRB5_PLUGIN_REGISTER_X (&__gss_krb5_plugin_register_x_oid_desc)
|
||||
|
||||
/* Extensions inquire context */
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_GET_TKT_FLAGS_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_EXTRACT_AUTHZ_DATA_FROM_SEC_CONTEXT_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_C_PEER_HAS_UPDATED_SPNEGO;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_EXPORT_LUCID_CONTEXT_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_EXPORT_LUCID_CONTEXT_V1_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_GET_SUBKEY_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_GET_INITIATOR_SUBKEY_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_GET_ACCEPTOR_SUBKEY_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_GET_AUTHTIME_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_GET_SERVICE_KEYBLOCK_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_get_tkt_flags_x_oid_desc;
|
||||
#define GSS_KRB5_GET_TKT_FLAGS_X (&__gss_krb5_get_tkt_flags_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_extract_authz_data_from_sec_context_x_oid_desc;
|
||||
#define GSS_KRB5_EXTRACT_AUTHZ_DATA_FROM_SEC_CONTEXT_X (&__gss_krb5_extract_authz_data_from_sec_context_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_c_peer_has_updated_spnego_oid_desc;
|
||||
#define GSS_C_PEER_HAS_UPDATED_SPNEGO (&__gss_c_peer_has_updated_spnego_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_export_lucid_context_x_oid_desc;
|
||||
#define GSS_KRB5_EXPORT_LUCID_CONTEXT_X (&__gss_krb5_export_lucid_context_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_export_lucid_context_v1_x_oid_desc;
|
||||
#define GSS_KRB5_EXPORT_LUCID_CONTEXT_V1_X (&__gss_krb5_export_lucid_context_v1_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_get_subkey_x_oid_desc;
|
||||
#define GSS_KRB5_GET_SUBKEY_X (&__gss_krb5_get_subkey_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_get_initiator_subkey_x_oid_desc;
|
||||
#define GSS_KRB5_GET_INITIATOR_SUBKEY_X (&__gss_krb5_get_initiator_subkey_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_get_acceptor_subkey_x_oid_desc;
|
||||
#define GSS_KRB5_GET_ACCEPTOR_SUBKEY_X (&__gss_krb5_get_acceptor_subkey_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_get_authtime_x_oid_desc;
|
||||
#define GSS_KRB5_GET_AUTHTIME_X (&__gss_krb5_get_authtime_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_get_service_keyblock_x_oid_desc;
|
||||
#define GSS_KRB5_GET_SERVICE_KEYBLOCK_X (&__gss_krb5_get_service_keyblock_x_oid_desc)
|
||||
|
||||
/* Extensions creds */
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_IMPORT_CRED_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_SET_ALLOWABLE_ENCTYPES_X;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_KRB5_CRED_NO_CI_FLAGS_X;
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_import_cred_x_oid_desc;
|
||||
#define GSS_KRB5_IMPORT_CRED_X (&__gss_krb5_import_cred_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_set_allowable_enctypes_x_oid_desc;
|
||||
#define GSS_KRB5_SET_ALLOWABLE_ENCTYPES_X (&__gss_krb5_set_allowable_enctypes_x_oid_desc)
|
||||
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_krb5_cred_no_ci_flags_x_oid_desc;
|
||||
#define GSS_KRB5_CRED_NO_CI_FLAGS_X (&__gss_krb5_cred_no_ci_flags_x_oid_desc)
|
||||
|
||||
/*
|
||||
* kerberos mechanism specific functions
|
||||
@ -100,42 +149,42 @@ struct krb5_keytab_data;
|
||||
struct krb5_ccache_data;
|
||||
struct Principal;
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_krb5_ccache_name(OM_uint32 * /*minor_status*/,
|
||||
const char * /*name */,
|
||||
const char ** /*out_name */);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gsskrb5_register_acceptor_identity
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gsskrb5_register_acceptor_identity
|
||||
(const char * /*identity*/);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION krb5_gss_register_acceptor_identity
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL krb5_gss_register_acceptor_identity
|
||||
(const char * /*identity*/);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_krb5_copy_ccache
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_krb5_copy_ccache
|
||||
(OM_uint32 * /*minor*/,
|
||||
gss_cred_id_t /*cred*/,
|
||||
struct krb5_ccache_data * /*out*/);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_krb5_import_cred(OM_uint32 * /*minor*/,
|
||||
struct krb5_ccache_data * /*in*/,
|
||||
struct Principal * /*keytab_principal*/,
|
||||
struct krb5_keytab_data * /*keytab*/,
|
||||
gss_cred_id_t * /*out*/);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION gss_krb5_get_tkt_flags
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL gss_krb5_get_tkt_flags
|
||||
(OM_uint32 * /*minor*/,
|
||||
gss_ctx_id_t /*context_handle*/,
|
||||
OM_uint32 * /*tkt_flags*/);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gsskrb5_extract_authz_data_from_sec_context
|
||||
(OM_uint32 * /*minor_status*/,
|
||||
gss_ctx_id_t /*context_handle*/,
|
||||
int /*ad_type*/,
|
||||
gss_buffer_t /*ad_data*/);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gsskrb5_set_dns_canonicalize(int);
|
||||
|
||||
struct gsskrb5_send_to_kdc {
|
||||
@ -143,35 +192,35 @@ struct gsskrb5_send_to_kdc {
|
||||
void *ptr;
|
||||
};
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gsskrb5_set_send_to_kdc(struct gsskrb5_send_to_kdc *)
|
||||
GSSKRB5_FUNCTION_DEPRECATED;
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gsskrb5_set_default_realm(const char *);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gsskrb5_extract_authtime_from_sec_context(OM_uint32 *, gss_ctx_id_t, time_t *);
|
||||
|
||||
struct EncryptionKey;
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gsskrb5_extract_service_keyblock(OM_uint32 *minor_status,
|
||||
gss_ctx_id_t context_handle,
|
||||
struct EncryptionKey **out);
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gsskrb5_get_initiator_subkey(OM_uint32 *minor_status,
|
||||
gss_ctx_id_t context_handle,
|
||||
struct EncryptionKey **out);
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gsskrb5_get_subkey(OM_uint32 *minor_status,
|
||||
gss_ctx_id_t context_handle,
|
||||
struct EncryptionKey **out);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gsskrb5_set_time_offset(int);
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gsskrb5_get_time_offset(int *);
|
||||
|
||||
struct gsskrb5_krb5_plugin {
|
||||
@ -180,7 +229,7 @@ struct gsskrb5_krb5_plugin {
|
||||
void *symbol;
|
||||
};
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gsskrb5_plugin_register(struct gsskrb5_krb5_plugin *);
|
||||
|
||||
|
||||
@ -226,19 +275,19 @@ typedef struct gss_krb5_lucid_context_version {
|
||||
* Function declarations
|
||||
*/
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_krb5_export_lucid_sec_context(OM_uint32 *minor_status,
|
||||
gss_ctx_id_t *context_handle,
|
||||
OM_uint32 version,
|
||||
void **kctx);
|
||||
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_krb5_free_lucid_sec_context(OM_uint32 *minor_status,
|
||||
void *kctx);
|
||||
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_krb5_set_allowable_enctypes(OM_uint32 *minor_status,
|
||||
gss_cred_id_t cred,
|
||||
OM_uint32 num_enctypes,
|
||||
|
@ -46,7 +46,8 @@ GSSAPI_CPP_START
|
||||
* negotiation token is identified by the Object Identifier
|
||||
* iso.org.dod.internet.security.mechanism.snego (1.3.6.1.5.5.2).
|
||||
*/
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID GSS_SPNEGO_MECHANISM;
|
||||
extern GSSAPI_LIB_VARIABLE gss_OID_desc __gss_spnego_mechanism_oid_desc;
|
||||
#define GSS_SPNEGO_MECHANISM (&__gss_spnego_mechanism_oid_desc)
|
||||
#define gss_mech_spnego GSS_SPNEGO_MECHANISM
|
||||
|
||||
GSSAPI_CPP_END
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
#include <gssapi.h>
|
||||
|
||||
typedef OM_uint32 _gss_acquire_cred_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_acquire_cred_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_name_t, /* desired_name */
|
||||
OM_uint32, /* time_req */
|
||||
@ -42,12 +42,12 @@ typedef OM_uint32 _gss_acquire_cred_t
|
||||
OM_uint32 * /* time_rec */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_release_cred_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_release_cred_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
gss_cred_id_t * /* cred_handle */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_init_sec_context_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_init_sec_context_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_cred_id_t, /* initiator_cred_handle */
|
||||
gss_ctx_id_t *, /* context_handle */
|
||||
@ -64,7 +64,7 @@ typedef OM_uint32 _gss_init_sec_context_t
|
||||
OM_uint32 * /* time_rec */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_accept_sec_context_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_accept_sec_context_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
gss_ctx_id_t *, /* context_handle */
|
||||
const gss_cred_id_t, /* acceptor_cred_handle */
|
||||
@ -79,25 +79,25 @@ typedef OM_uint32 _gss_accept_sec_context_t
|
||||
gss_cred_id_t * /* delegated_cred_handle */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_process_context_token_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_process_context_token_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_ctx_id_t, /* context_handle */
|
||||
const gss_buffer_t /* token_buffer */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_delete_sec_context_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_delete_sec_context_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
gss_ctx_id_t *, /* context_handle */
|
||||
gss_buffer_t /* output_token */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_context_time_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_context_time_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_ctx_id_t, /* context_handle */
|
||||
OM_uint32 * /* time_rec */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_get_mic_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_get_mic_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_ctx_id_t, /* context_handle */
|
||||
gss_qop_t, /* qop_req */
|
||||
@ -105,7 +105,7 @@ typedef OM_uint32 _gss_get_mic_t
|
||||
gss_buffer_t /* message_token */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_verify_mic_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_verify_mic_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_ctx_id_t, /* context_handle */
|
||||
const gss_buffer_t, /* message_buffer */
|
||||
@ -113,7 +113,7 @@ typedef OM_uint32 _gss_verify_mic_t
|
||||
gss_qop_t * /* qop_state */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_wrap_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_wrap_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_ctx_id_t, /* context_handle */
|
||||
int, /* conf_req_flag */
|
||||
@ -123,7 +123,7 @@ typedef OM_uint32 _gss_wrap_t
|
||||
gss_buffer_t /* output_message_buffer */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_unwrap_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_unwrap_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_ctx_id_t, /* context_handle */
|
||||
const gss_buffer_t, /* input_message_buffer */
|
||||
@ -132,7 +132,7 @@ typedef OM_uint32 _gss_unwrap_t
|
||||
gss_qop_t * /* qop_state */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_display_status_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_display_status_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
OM_uint32, /* status_value */
|
||||
int, /* status_type */
|
||||
@ -141,44 +141,44 @@ typedef OM_uint32 _gss_display_status_t
|
||||
gss_buffer_t /* status_string */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_indicate_mechs_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_indicate_mechs_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
gss_OID_set * /* mech_set */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_compare_name_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_compare_name_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_name_t, /* name1 */
|
||||
const gss_name_t, /* name2 */
|
||||
int * /* name_equal */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_display_name_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_display_name_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_name_t, /* input_name */
|
||||
gss_buffer_t, /* output_name_buffer */
|
||||
gss_OID * /* output_name_type */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_import_name_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_import_name_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_buffer_t, /* input_name_buffer */
|
||||
const gss_OID, /* input_name_type */
|
||||
gss_name_t * /* output_name */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_export_name_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_export_name_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_name_t, /* input_name */
|
||||
gss_buffer_t /* exported_name */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_release_name_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_release_name_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
gss_name_t * /* input_name */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_inquire_cred_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_cred_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_cred_id_t, /* cred_handle */
|
||||
gss_name_t *, /* name */
|
||||
@ -187,7 +187,7 @@ typedef OM_uint32 _gss_inquire_cred_t
|
||||
gss_OID_set * /* mechanisms */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_inquire_context_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_context_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_ctx_id_t, /* context_handle */
|
||||
gss_name_t *, /* src_name */
|
||||
@ -199,7 +199,7 @@ typedef OM_uint32 _gss_inquire_context_t
|
||||
int * /* open */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_wrap_size_limit_t
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_wrap_size_limit_t
|
||||
(OM_uint32 *, /* minor_status */
|
||||
const gss_ctx_id_t, /* context_handle */
|
||||
int, /* conf_req_flag */
|
||||
@ -208,7 +208,7 @@ typedef OM_uint32 _gss_wrap_size_limit_t
|
||||
OM_uint32 * /* max_input_size */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_add_cred_t (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_add_cred_t (
|
||||
OM_uint32 *, /* minor_status */
|
||||
const gss_cred_id_t, /* input_cred_handle */
|
||||
const gss_name_t, /* desired_name */
|
||||
@ -222,7 +222,7 @@ typedef OM_uint32 _gss_add_cred_t (
|
||||
OM_uint32 * /* acceptor_time_rec */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_inquire_cred_by_mech_t (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_cred_by_mech_t (
|
||||
OM_uint32 *, /* minor_status */
|
||||
const gss_cred_id_t, /* cred_handle */
|
||||
const gss_OID, /* mech_type */
|
||||
@ -232,65 +232,65 @@ typedef OM_uint32 _gss_inquire_cred_by_mech_t (
|
||||
gss_cred_usage_t * /* cred_usage */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_export_sec_context_t (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_export_sec_context_t (
|
||||
OM_uint32 *, /* minor_status */
|
||||
gss_ctx_id_t *, /* context_handle */
|
||||
gss_buffer_t /* interprocess_token */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_import_sec_context_t (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_import_sec_context_t (
|
||||
OM_uint32 *, /* minor_status */
|
||||
const gss_buffer_t, /* interprocess_token */
|
||||
gss_ctx_id_t * /* context_handle */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_inquire_names_for_mech_t (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_names_for_mech_t (
|
||||
OM_uint32 *, /* minor_status */
|
||||
const gss_OID, /* mechanism */
|
||||
gss_OID_set * /* name_types */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_inquire_mechs_for_name_t (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_mechs_for_name_t (
|
||||
OM_uint32 *, /* minor_status */
|
||||
const gss_name_t, /* input_name */
|
||||
gss_OID_set * /* mech_types */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_canonicalize_name_t (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_canonicalize_name_t (
|
||||
OM_uint32 *, /* minor_status */
|
||||
const gss_name_t, /* input_name */
|
||||
const gss_OID, /* mech_type */
|
||||
gss_name_t * /* output_name */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_duplicate_name_t (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_duplicate_name_t (
|
||||
OM_uint32 *, /* minor_status */
|
||||
const gss_name_t, /* src_name */
|
||||
gss_name_t * /* dest_name */
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_inquire_sec_context_by_oid (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_sec_context_by_oid (
|
||||
OM_uint32 *minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
const gss_OID desired_object,
|
||||
gss_buffer_set_t *data_set
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_inquire_cred_by_oid (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_inquire_cred_by_oid (
|
||||
OM_uint32 *minor_status,
|
||||
const gss_cred_id_t cred,
|
||||
const gss_OID desired_object,
|
||||
gss_buffer_set_t *data_set
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_set_sec_context_option (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_set_sec_context_option (
|
||||
OM_uint32 *minor_status,
|
||||
gss_ctx_id_t *cred_handle,
|
||||
const gss_OID desired_object,
|
||||
const gss_buffer_t value
|
||||
);
|
||||
|
||||
typedef OM_uint32 _gss_set_cred_option (
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_set_cred_option (
|
||||
OM_uint32 *minor_status,
|
||||
gss_cred_id_t *cred_handle,
|
||||
const gss_OID desired_object,
|
||||
@ -298,7 +298,7 @@ typedef OM_uint32 _gss_set_cred_option (
|
||||
);
|
||||
|
||||
|
||||
typedef OM_uint32 _gss_pseudo_random(
|
||||
typedef OM_uint32 GSSAPI_CALLCONV _gss_pseudo_random(
|
||||
OM_uint32 *minor_status,
|
||||
gss_ctx_id_t context,
|
||||
int prf_key,
|
||||
@ -307,7 +307,7 @@ typedef OM_uint32 _gss_pseudo_random(
|
||||
gss_buffer_t prf_out
|
||||
);
|
||||
|
||||
typedef OM_uint32
|
||||
typedef OM_uint32 GSSAPI_CALLCONV
|
||||
_gss_wrap_iov_t(OM_uint32 *minor_status,
|
||||
gss_ctx_id_t context_handle,
|
||||
int conf_req_flag,
|
||||
@ -316,7 +316,7 @@ _gss_wrap_iov_t(OM_uint32 *minor_status,
|
||||
gss_iov_buffer_desc *iov,
|
||||
int iov_count);
|
||||
|
||||
typedef OM_uint32
|
||||
typedef OM_uint32 GSSAPI_CALLCONV
|
||||
_gss_unwrap_iov_t(OM_uint32 *minor_status,
|
||||
gss_ctx_id_t context_handle,
|
||||
int *conf_state,
|
||||
@ -324,7 +324,7 @@ _gss_unwrap_iov_t(OM_uint32 *minor_status,
|
||||
gss_iov_buffer_desc *iov,
|
||||
int iov_count);
|
||||
|
||||
typedef OM_uint32
|
||||
typedef OM_uint32 GSSAPI_CALLCONV
|
||||
_gss_wrap_iov_length_t(OM_uint32 * minor_status,
|
||||
gss_ctx_id_t context_handle,
|
||||
int conf_req_flag,
|
||||
@ -333,7 +333,7 @@ _gss_wrap_iov_length_t(OM_uint32 * minor_status,
|
||||
gss_iov_buffer_desc *iov,
|
||||
int iov_count);
|
||||
|
||||
typedef OM_uint32
|
||||
typedef OM_uint32 GSSAPI_CALLCONV
|
||||
_gss_store_cred_t(OM_uint32 *minor_status,
|
||||
gss_cred_id_t input_cred_handle,
|
||||
gss_cred_usage_t cred_usage,
|
||||
@ -343,12 +343,12 @@ _gss_store_cred_t(OM_uint32 *minor_status,
|
||||
gss_OID_set *elements_stored,
|
||||
gss_cred_usage_t *cred_usage_stored);
|
||||
|
||||
typedef OM_uint32
|
||||
typedef OM_uint32 GSSAPI_CALLCONV
|
||||
_gss_export_cred_t(OM_uint32 *minor_status,
|
||||
gss_cred_id_t cred_handle,
|
||||
gss_buffer_t cred_token);
|
||||
|
||||
typedef OM_uint32
|
||||
typedef OM_uint32 GSSAPI_CALLCONV
|
||||
_gss_import_cred_t(OM_uint32 * minor_status,
|
||||
gss_buffer_t cred_token,
|
||||
gss_cred_id_t * cred_handle);
|
||||
|
@ -182,11 +182,6 @@ _gsskrb5_verify_8003_checksum(
|
||||
int DlgOpt;
|
||||
static unsigned char zeros[16];
|
||||
|
||||
if (cksum == NULL) {
|
||||
*minor_status = 0;
|
||||
return GSS_S_BAD_BINDINGS;
|
||||
}
|
||||
|
||||
/* XXX should handle checksums > 24 bytes */
|
||||
if(cksum->cksumtype != CKSUMTYPE_GSSAPI || cksum->checksum.length < 24) {
|
||||
*minor_status = 0;
|
||||
|
@ -55,10 +55,10 @@ _gsskrb5_register_acceptor_identity (const char *identity)
|
||||
if (identity == NULL) {
|
||||
ret = krb5_kt_default(context, &_gsskrb5_keytab);
|
||||
} else {
|
||||
char *p;
|
||||
char *p = NULL;
|
||||
|
||||
asprintf(&p, "FILE:%s", identity);
|
||||
if(p == NULL) {
|
||||
ret = asprintf(&p, "FILE:%s", identity);
|
||||
if(ret < 0 || p == NULL) {
|
||||
HEIMDAL_MUTEX_unlock(&gssapi_keytab_mutex);
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
@ -462,6 +462,7 @@ gsskrb5_acceptor_start(OM_uint32 * minor_status,
|
||||
/*
|
||||
* We need to get the flags out of the 8003 checksum.
|
||||
*/
|
||||
|
||||
{
|
||||
krb5_authenticator authenticator;
|
||||
|
||||
@ -474,6 +475,12 @@ gsskrb5_acceptor_start(OM_uint32 * minor_status,
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (authenticator->cksum == NULL) {
|
||||
krb5_free_authenticator(context, &authenticator);
|
||||
*minor_status = 0;
|
||||
return GSS_S_BAD_BINDINGS;
|
||||
}
|
||||
|
||||
if (authenticator->cksum->cksumtype == CKSUMTYPE_GSSAPI) {
|
||||
ret = _gsskrb5_verify_8003_checksum(minor_status,
|
||||
input_chan_bindings,
|
||||
@ -793,7 +800,7 @@ acceptor_wait_for_dcestyle(OM_uint32 * minor_status,
|
||||
}
|
||||
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gsskrb5_accept_sec_context(OM_uint32 * minor_status,
|
||||
gss_ctx_id_t * context_handle,
|
||||
const gss_cred_id_t acceptor_cred_handle,
|
||||
|
@ -288,7 +288,7 @@ end:
|
||||
return (ret);
|
||||
}
|
||||
|
||||
OM_uint32 _gsskrb5_acquire_cred
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_acquire_cred
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_name_t desired_name,
|
||||
OM_uint32 time_req,
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_add_cred (
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_add_cred (
|
||||
OM_uint32 *minor_status,
|
||||
const gss_cred_id_t input_cred_handle,
|
||||
const gss_name_t desired_name,
|
||||
@ -155,7 +155,7 @@ OM_uint32 _gsskrb5_add_cred (
|
||||
|
||||
if (cred->ccache) {
|
||||
const char *type, *name;
|
||||
char *type_name;
|
||||
char *type_name = NULL;
|
||||
|
||||
ret = GSS_S_FAILURE;
|
||||
|
||||
@ -187,8 +187,8 @@ OM_uint32 _gsskrb5_add_cred (
|
||||
goto failure;
|
||||
}
|
||||
|
||||
asprintf(&type_name, "%s:%s", type, name);
|
||||
if (type_name == NULL) {
|
||||
kret = asprintf(&type_name, "%s:%s", type, name);
|
||||
if (kret < 0 || type_name == NULL) {
|
||||
*minor_status = ENOMEM;
|
||||
goto failure;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#include <roken.h>
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gk_wrap_iov(OM_uint32 * minor_status,
|
||||
gss_ctx_id_t context_handle,
|
||||
int conf_req_flag,
|
||||
@ -57,7 +57,7 @@ _gk_wrap_iov(OM_uint32 * minor_status,
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gk_unwrap_iov(OM_uint32 *minor_status,
|
||||
gss_ctx_id_t context_handle,
|
||||
int *conf_state,
|
||||
@ -77,7 +77,7 @@ _gk_unwrap_iov(OM_uint32 *minor_status,
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gk_wrap_iov_length(OM_uint32 * minor_status,
|
||||
gss_ctx_id_t context_handle,
|
||||
int conf_req_flag,
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_canonicalize_name (
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_canonicalize_name (
|
||||
OM_uint32 * minor_status,
|
||||
const gss_name_t input_name,
|
||||
const gss_OID mech_type,
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_compare_name
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_compare_name
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_name_t name1,
|
||||
const gss_name_t name2,
|
||||
|
@ -62,7 +62,7 @@ _gsskrb5_lifetime_left(OM_uint32 *minor_status,
|
||||
}
|
||||
|
||||
|
||||
OM_uint32 _gsskrb5_context_time
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_context_time
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
OM_uint32 * time_rec
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gsskrb5_export_cred(OM_uint32 *minor_status,
|
||||
gss_cred_id_t cred_handle,
|
||||
gss_buffer_t cred_token)
|
||||
@ -154,7 +154,7 @@ _gsskrb5_export_cred(OM_uint32 *minor_status,
|
||||
return GSS_S_COMPLETE;
|
||||
}
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gsskrb5_import_cred(OM_uint32 * minor_status,
|
||||
gss_buffer_t cred_token,
|
||||
gss_cred_id_t * cred_handle)
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gsskrb5_delete_sec_context(OM_uint32 * minor_status,
|
||||
gss_ctx_id_t * context_handle,
|
||||
gss_buffer_t output_token)
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_display_name
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_display_name
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_name_t input_name,
|
||||
gss_buffer_t output_name_buffer,
|
||||
|
@ -125,20 +125,21 @@ _gsskrb5_set_status (int ret, const char *fmt, ...)
|
||||
krb5_context context;
|
||||
va_list args;
|
||||
char *str;
|
||||
int e;
|
||||
|
||||
if (_gsskrb5_init (&context) != 0)
|
||||
return;
|
||||
|
||||
va_start(args, fmt);
|
||||
vasprintf(&str, fmt, args);
|
||||
e = vasprintf(&str, fmt, args);
|
||||
va_end(args);
|
||||
if (str) {
|
||||
if (e >= 0 && str) {
|
||||
krb5_set_error_message(context, ret, "%s", str);
|
||||
free(str);
|
||||
}
|
||||
}
|
||||
|
||||
OM_uint32 _gsskrb5_display_status
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_display_status
|
||||
(OM_uint32 *minor_status,
|
||||
OM_uint32 status_value,
|
||||
int status_type,
|
||||
@ -147,7 +148,8 @@ OM_uint32 _gsskrb5_display_status
|
||||
gss_buffer_t status_string)
|
||||
{
|
||||
krb5_context context;
|
||||
char *buf;
|
||||
char *buf = NULL;
|
||||
int e = 0;
|
||||
|
||||
GSSAPI_KRB5_INIT (&context);
|
||||
|
||||
@ -162,27 +164,27 @@ OM_uint32 _gsskrb5_display_status
|
||||
|
||||
if (status_type == GSS_C_GSS_CODE) {
|
||||
if (GSS_SUPPLEMENTARY_INFO(status_value))
|
||||
asprintf(&buf, "%s",
|
||||
supplementary_error(GSS_SUPPLEMENTARY_INFO(status_value)));
|
||||
e = asprintf(&buf, "%s",
|
||||
supplementary_error(GSS_SUPPLEMENTARY_INFO(status_value)));
|
||||
else
|
||||
asprintf (&buf, "%s %s",
|
||||
calling_error(GSS_CALLING_ERROR(status_value)),
|
||||
routine_error(GSS_ROUTINE_ERROR(status_value)));
|
||||
e = asprintf (&buf, "%s %s",
|
||||
calling_error(GSS_CALLING_ERROR(status_value)),
|
||||
routine_error(GSS_ROUTINE_ERROR(status_value)));
|
||||
} else if (status_type == GSS_C_MECH_CODE) {
|
||||
const char *buf2 = krb5_get_error_message(context, status_value);
|
||||
if (buf2) {
|
||||
buf = strdup(buf2);
|
||||
krb5_free_error_message(context, buf2);
|
||||
} else {
|
||||
asprintf(&buf, "unknown mech error-code %u",
|
||||
(unsigned)status_value);
|
||||
e = asprintf(&buf, "unknown mech error-code %u",
|
||||
(unsigned)status_value);
|
||||
}
|
||||
} else {
|
||||
*minor_status = EINVAL;
|
||||
return GSS_S_BAD_STATUS;
|
||||
}
|
||||
|
||||
if (buf == NULL) {
|
||||
if (e < 0 || buf == NULL) {
|
||||
*minor_status = ENOMEM;
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_duplicate_name (
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_duplicate_name (
|
||||
OM_uint32 * minor_status,
|
||||
const gss_name_t src_name,
|
||||
gss_name_t * dest_name
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_export_name
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_export_name
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_name_t input_name,
|
||||
gss_buffer_t exported_name
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gsskrb5_export_sec_context (
|
||||
OM_uint32 * minor_status,
|
||||
gss_ctx_id_t * context_handle,
|
||||
|
@ -46,12 +46,9 @@
|
||||
* to that gss_OID_desc.
|
||||
*/
|
||||
|
||||
static gss_OID_desc gss_c_nt_user_name_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_nt_user_name_oid_desc =
|
||||
{10, rk_UNCONST("\x2a\x86\x48\x86\xf7\x12" "\x01\x02\x01\x01")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_C_NT_USER_NAME =
|
||||
&gss_c_nt_user_name_oid_desc;
|
||||
|
||||
/*
|
||||
* The implementation must reserve static storage for a
|
||||
* gss_OID_desc object containing the value
|
||||
@ -64,12 +61,9 @@ gss_OID GSSAPI_LIB_VARIABLE GSS_C_NT_USER_NAME =
|
||||
* initialized to point to that gss_OID_desc.
|
||||
*/
|
||||
|
||||
static gss_OID_desc gss_c_nt_machine_uid_name_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_nt_machine_uid_name_oid_desc =
|
||||
{10, rk_UNCONST("\x2a\x86\x48\x86\xf7\x12" "\x01\x02\x01\x02")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_C_NT_MACHINE_UID_NAME =
|
||||
&gss_c_nt_machine_uid_name_oid_desc;
|
||||
|
||||
/*
|
||||
* The implementation must reserve static storage for a
|
||||
* gss_OID_desc object containing the value
|
||||
@ -82,12 +76,9 @@ gss_OID GSSAPI_LIB_VARIABLE GSS_C_NT_MACHINE_UID_NAME =
|
||||
* initialized to point to that gss_OID_desc.
|
||||
*/
|
||||
|
||||
static gss_OID_desc gss_c_nt_string_uid_name_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_nt_string_uid_name_oid_desc =
|
||||
{10, rk_UNCONST("\x2a\x86\x48\x86\xf7\x12" "\x01\x02\x01\x03")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_C_NT_STRING_UID_NAME =
|
||||
&gss_c_nt_string_uid_name_oid_desc;
|
||||
|
||||
/*
|
||||
* The implementation must reserve static storage for a
|
||||
* gss_OID_desc object containing the value
|
||||
@ -106,12 +97,9 @@ gss_OID GSSAPI_LIB_VARIABLE GSS_C_NT_STRING_UID_NAME =
|
||||
* implementations
|
||||
*/
|
||||
|
||||
static gss_OID_desc gss_c_nt_hostbased_service_x_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_nt_hostbased_service_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2b\x06\x01\x05\x06\x02")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_C_NT_HOSTBASED_SERVICE_X =
|
||||
&gss_c_nt_hostbased_service_x_oid_desc;
|
||||
|
||||
/*
|
||||
* The implementation must reserve static storage for a
|
||||
* gss_OID_desc object containing the value
|
||||
@ -123,12 +111,9 @@ gss_OID GSSAPI_LIB_VARIABLE GSS_C_NT_HOSTBASED_SERVICE_X =
|
||||
* GSS_C_NT_HOSTBASED_SERVICE should be initialized
|
||||
* to point to that gss_OID_desc.
|
||||
*/
|
||||
static gss_OID_desc gss_c_nt_hostbased_service_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_nt_hostbased_service_oid_desc =
|
||||
{10, rk_UNCONST("\x2a\x86\x48\x86\xf7\x12" "\x01\x02\x01\x04")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_C_NT_HOSTBASED_SERVICE =
|
||||
&gss_c_nt_hostbased_service_oid_desc;
|
||||
|
||||
/*
|
||||
* The implementation must reserve static storage for a
|
||||
* gss_OID_desc object containing the value
|
||||
@ -140,12 +125,9 @@ gss_OID GSSAPI_LIB_VARIABLE GSS_C_NT_HOSTBASED_SERVICE =
|
||||
* to that gss_OID_desc.
|
||||
*/
|
||||
|
||||
static gss_OID_desc gss_c_nt_anonymous_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_nt_anonymous_oid_desc =
|
||||
{6, rk_UNCONST("\x2b\x06\01\x05\x06\x03")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_C_NT_ANONYMOUS =
|
||||
&gss_c_nt_anonymous_oid_desc;
|
||||
|
||||
/*
|
||||
* The implementation must reserve static storage for a
|
||||
* gss_OID_desc object containing the value
|
||||
@ -157,12 +139,9 @@ gss_OID GSSAPI_LIB_VARIABLE GSS_C_NT_ANONYMOUS =
|
||||
* to that gss_OID_desc.
|
||||
*/
|
||||
|
||||
static gss_OID_desc gss_c_nt_export_name_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_nt_export_name_oid_desc =
|
||||
{6, rk_UNCONST("\x2b\x06\x01\x05\x06\x04") };
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_C_NT_EXPORT_NAME =
|
||||
&gss_c_nt_export_name_oid_desc;
|
||||
|
||||
/*
|
||||
* This name form shall be represented by the Object Identifier {iso(1)
|
||||
* member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
|
||||
@ -170,12 +149,9 @@ gss_OID GSSAPI_LIB_VARIABLE GSS_C_NT_EXPORT_NAME =
|
||||
* is "GSS_KRB5_NT_PRINCIPAL_NAME".
|
||||
*/
|
||||
|
||||
static gss_OID_desc gss_krb5_nt_principal_name_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_nt_principal_name_oid_desc =
|
||||
{10, rk_UNCONST("\x2a\x86\x48\x86\xf7\x12\x01\x02\x02\x01") };
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_NT_PRINCIPAL_NAME =
|
||||
&gss_krb5_nt_principal_name_oid_desc;
|
||||
|
||||
/*
|
||||
* This name form shall be represented by the Object Identifier {iso(1)
|
||||
* member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
|
||||
@ -183,9 +159,6 @@ gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_NT_PRINCIPAL_NAME =
|
||||
* type is "GSS_KRB5_NT_USER_NAME".
|
||||
*/
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_NT_USER_NAME =
|
||||
&gss_c_nt_user_name_oid_desc;
|
||||
|
||||
/*
|
||||
* This name form shall be represented by the Object Identifier {iso(1)
|
||||
* member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
|
||||
@ -193,9 +166,6 @@ gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_NT_USER_NAME =
|
||||
* this type is "GSS_KRB5_NT_MACHINE_UID_NAME".
|
||||
*/
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_NT_MACHINE_UID_NAME =
|
||||
&gss_c_nt_machine_uid_name_oid_desc;
|
||||
|
||||
/*
|
||||
* This name form shall be represented by the Object Identifier {iso(1)
|
||||
* member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
|
||||
@ -203,9 +173,6 @@ gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_NT_MACHINE_UID_NAME =
|
||||
* this type is "GSS_KRB5_NT_STRING_UID_NAME".
|
||||
*/
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_NT_STRING_UID_NAME =
|
||||
&gss_c_nt_string_uid_name_oid_desc;
|
||||
|
||||
/*
|
||||
* To support ongoing experimentation, testing, and evolution of the
|
||||
* specification, the Kerberos V5 GSS-API mechanism as defined in this
|
||||
@ -223,19 +190,9 @@ gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_NT_STRING_UID_NAME =
|
||||
* gssapi(2) krb5(2)}
|
||||
*/
|
||||
|
||||
#if 0 /* This is the old OID */
|
||||
|
||||
static gss_OID_desc gss_krb5_mechanism_oid_desc =
|
||||
{5, rk_UNCONST("\x2b\x05\x01\x05\x02")};
|
||||
|
||||
#endif
|
||||
|
||||
static gss_OID_desc gss_krb5_mechanism_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_mechanism_oid_desc =
|
||||
{9, rk_UNCONST("\x2a\x86\x48\x86\xf7\x12\x01\x02\x02") };
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_MECHANISM =
|
||||
&gss_krb5_mechanism_oid_desc;
|
||||
|
||||
/*
|
||||
* draft-ietf-cat-iakerb-09, IAKERB:
|
||||
* The mechanism ID for IAKERB proxy GSS-API Kerberos, in accordance
|
||||
@ -249,179 +206,107 @@ gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_MECHANISM =
|
||||
* iakerbMinimumMessagesProtocol(2)}.
|
||||
*/
|
||||
|
||||
static gss_OID_desc gss_iakerb_proxy_mechanism_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_iakerb_proxy_mechanism_oid_desc =
|
||||
{7, rk_UNCONST("\x2b\x06\x01\x05\x05\x0a\x01")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_IAKERB_PROXY_MECHANISM =
|
||||
&gss_iakerb_proxy_mechanism_oid_desc;
|
||||
|
||||
static gss_OID_desc gss_iakerb_min_msg_mechanism_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_iakerb_min_msg_mechanism_oid_desc =
|
||||
{7, rk_UNCONST("\x2b\x06\x01\x05\x05\x0a\x02") };
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_IAKERB_MIN_MSG_MECHANISM =
|
||||
&gss_iakerb_min_msg_mechanism_oid_desc;
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
static gss_OID_desc gss_c_peer_has_updated_spnego_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_c_peer_has_updated_spnego_oid_desc =
|
||||
{9, (void *)"\x2b\x06\x01\x04\x01\xa9\x4a\x13\x05"};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_C_PEER_HAS_UPDATED_SPNEGO =
|
||||
&gss_c_peer_has_updated_spnego_oid_desc;
|
||||
|
||||
/*
|
||||
* 1.2.752.43.13 Heimdal GSS-API Extentions
|
||||
*/
|
||||
|
||||
/* 1.2.752.43.13.1 */
|
||||
static gss_OID_desc gss_krb5_copy_ccache_x_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_copy_ccache_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x01")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_COPY_CCACHE_X =
|
||||
&gss_krb5_copy_ccache_x_oid_desc;
|
||||
|
||||
/* 1.2.752.43.13.2 */
|
||||
static gss_OID_desc gss_krb5_get_tkt_flags_x_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_get_tkt_flags_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x02")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_GET_TKT_FLAGS_X =
|
||||
&gss_krb5_get_tkt_flags_x_oid_desc;
|
||||
|
||||
/* 1.2.752.43.13.3 */
|
||||
static gss_OID_desc gss_krb5_extract_authz_data_from_sec_context_x_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_extract_authz_data_from_sec_context_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x03")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_EXTRACT_AUTHZ_DATA_FROM_SEC_CONTEXT_X =
|
||||
&gss_krb5_extract_authz_data_from_sec_context_x_oid_desc;
|
||||
|
||||
/* 1.2.752.43.13.4 */
|
||||
static gss_OID_desc gss_krb5_compat_des3_mic_x_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_compat_des3_mic_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x04")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_COMPAT_DES3_MIC_X =
|
||||
&gss_krb5_compat_des3_mic_x_oid_desc;
|
||||
|
||||
/* 1.2.752.43.13.5 */
|
||||
static gss_OID_desc gss_krb5_register_acceptor_identity_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_register_acceptor_identity_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x05")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_REGISTER_ACCEPTOR_IDENTITY_X =
|
||||
&gss_krb5_register_acceptor_identity_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.6 */
|
||||
static gss_OID_desc gss_krb5_export_lucid_context_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_export_lucid_context_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x06")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_EXPORT_LUCID_CONTEXT_X =
|
||||
&gss_krb5_export_lucid_context_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.6.1 */
|
||||
static gss_OID_desc gss_krb5_export_lucid_context_v1_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_export_lucid_context_v1_x_oid_desc =
|
||||
{7, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x06\x01")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_EXPORT_LUCID_CONTEXT_V1_X =
|
||||
&gss_krb5_export_lucid_context_v1_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.7 */
|
||||
static gss_OID_desc gss_krb5_set_dns_canonicalize_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_set_dns_canonicalize_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x07")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_SET_DNS_CANONICALIZE_X =
|
||||
&gss_krb5_set_dns_canonicalize_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.8 */
|
||||
static gss_OID_desc gss_krb5_get_subkey_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_get_subkey_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x08")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_GET_SUBKEY_X =
|
||||
&gss_krb5_get_subkey_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.9 */
|
||||
static gss_OID_desc gss_krb5_get_initiator_subkey_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_get_initiator_subkey_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x09")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_GET_INITIATOR_SUBKEY_X =
|
||||
&gss_krb5_get_initiator_subkey_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.10 */
|
||||
static gss_OID_desc gss_krb5_get_acceptor_subkey_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_get_acceptor_subkey_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x0a")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_GET_ACCEPTOR_SUBKEY_X =
|
||||
&gss_krb5_get_acceptor_subkey_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.11 */
|
||||
static gss_OID_desc gss_krb5_send_to_kdc_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_send_to_kdc_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x0b")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_SEND_TO_KDC_X =
|
||||
&gss_krb5_send_to_kdc_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.12 */
|
||||
static gss_OID_desc gss_krb5_get_authtime_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_get_authtime_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x0c")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_GET_AUTHTIME_X =
|
||||
&gss_krb5_get_authtime_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.13 */
|
||||
static gss_OID_desc gss_krb5_get_service_keyblock_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_get_service_keyblock_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x0d")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_GET_SERVICE_KEYBLOCK_X =
|
||||
&gss_krb5_get_service_keyblock_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.14 */
|
||||
static gss_OID_desc gss_krb5_set_allowable_enctypes_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_set_allowable_enctypes_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x0e")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_SET_ALLOWABLE_ENCTYPES_X =
|
||||
&gss_krb5_set_allowable_enctypes_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.15 */
|
||||
static gss_OID_desc gss_krb5_set_default_realm_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_set_default_realm_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x0f")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_SET_DEFAULT_REALM_X =
|
||||
&gss_krb5_set_default_realm_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.16 */
|
||||
static gss_OID_desc gss_krb5_ccache_name_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_ccache_name_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x10")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_CCACHE_NAME_X =
|
||||
&gss_krb5_ccache_name_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.17 */
|
||||
static gss_OID_desc gss_krb5_set_time_offset_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_set_time_offset_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x11")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_SET_TIME_OFFSET_X =
|
||||
&gss_krb5_set_time_offset_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.18 */
|
||||
static gss_OID_desc gss_krb5_get_time_offset_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_get_time_offset_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x12")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_GET_TIME_OFFSET_X =
|
||||
&gss_krb5_get_time_offset_x_desc;
|
||||
|
||||
/* 1.2.752.43.13.19 */
|
||||
static gss_OID_desc gss_krb5_plugin_register_x_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_plugin_register_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x13")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_KRB5_PLUGIN_REGISTER_X =
|
||||
&gss_krb5_plugin_register_x_desc;
|
||||
|
||||
/* 1.2.752.43.14.1 */
|
||||
static gss_OID_desc gss_sasl_digest_md5_mechanism_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_sasl_digest_md5_mechanism_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0e\x01") };
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_SASL_DIGEST_MD5_MECHANISM =
|
||||
&gss_sasl_digest_md5_mechanism_desc;
|
||||
|
||||
/*
|
||||
* Context for krb5 calls.
|
||||
*/
|
||||
|
@ -273,7 +273,7 @@ mic_des3
|
||||
return GSS_S_COMPLETE;
|
||||
}
|
||||
|
||||
OM_uint32 _gsskrb5_get_mic
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_get_mic
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
gss_qop_t qop_req,
|
||||
|
@ -215,7 +215,7 @@ import_export_name (OM_uint32 *minor_status,
|
||||
return ret;
|
||||
}
|
||||
|
||||
OM_uint32 _gsskrb5_import_name
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_import_name
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_buffer_t input_name_buffer,
|
||||
const gss_OID input_name_type,
|
||||
@ -235,7 +235,7 @@ OM_uint32 _gsskrb5_import_name
|
||||
context,
|
||||
input_name_buffer,
|
||||
output_name);
|
||||
else if (gss_oid_equal(input_name_type, GSS_C_NO_OID)
|
||||
else if (input_name_type == GSS_C_NO_OID
|
||||
|| gss_oid_equal(input_name_type, GSS_C_NT_USER_NAME)
|
||||
|| gss_oid_equal(input_name_type, GSS_KRB5_NT_PRINCIPAL_NAME))
|
||||
/* default printable syntax */
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gsskrb5_import_sec_context (
|
||||
OM_uint32 * minor_status,
|
||||
const gss_buffer_t interprocess_token,
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_indicate_mechs
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_indicate_mechs
|
||||
(OM_uint32 * minor_status,
|
||||
gss_OID_set * mech_set
|
||||
)
|
||||
|
@ -838,7 +838,7 @@ repl_mutual
|
||||
* gss_init_sec_context
|
||||
*/
|
||||
|
||||
OM_uint32 _gsskrb5_init_sec_context
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_init_sec_context
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_cred_id_t cred_handle,
|
||||
gss_ctx_id_t * context_handle,
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_inquire_context (
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_inquire_context (
|
||||
OM_uint32 * minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
gss_name_t * src_name,
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_inquire_cred
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_inquire_cred
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_cred_id_t cred_handle,
|
||||
gss_name_t * output_name,
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_inquire_cred_by_mech (
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_inquire_cred_by_mech (
|
||||
OM_uint32 * minor_status,
|
||||
const gss_cred_id_t cred_handle,
|
||||
const gss_OID mech_type,
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_inquire_cred_by_oid
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_inquire_cred_by_oid
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_cred_id_t cred_handle,
|
||||
const gss_OID desired_object,
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_inquire_mechs_for_name (
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_inquire_mechs_for_name (
|
||||
OM_uint32 * minor_status,
|
||||
const gss_name_t input_name,
|
||||
gss_OID_set * mech_types
|
||||
|
@ -33,15 +33,15 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
static gss_OID *name_list[] = {
|
||||
&GSS_C_NT_HOSTBASED_SERVICE,
|
||||
&GSS_C_NT_USER_NAME,
|
||||
&GSS_KRB5_NT_PRINCIPAL_NAME,
|
||||
&GSS_C_NT_EXPORT_NAME,
|
||||
static gss_OID name_list[] = {
|
||||
GSS_C_NT_HOSTBASED_SERVICE,
|
||||
GSS_C_NT_USER_NAME,
|
||||
GSS_KRB5_NT_PRINCIPAL_NAME,
|
||||
GSS_C_NT_EXPORT_NAME,
|
||||
NULL
|
||||
};
|
||||
|
||||
OM_uint32 _gsskrb5_inquire_names_for_mech (
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_inquire_names_for_mech (
|
||||
OM_uint32 * minor_status,
|
||||
const gss_OID mechanism,
|
||||
gss_OID_set * name_types
|
||||
@ -64,7 +64,7 @@ OM_uint32 _gsskrb5_inquire_names_for_mech (
|
||||
|
||||
for (i = 0; name_list[i] != NULL; i++) {
|
||||
ret = gss_add_oid_set_member(minor_status,
|
||||
*(name_list[i]),
|
||||
name_list[i],
|
||||
name_types);
|
||||
if (ret != GSS_S_COMPLETE)
|
||||
break;
|
||||
|
@ -487,7 +487,7 @@ out:
|
||||
*
|
||||
*/
|
||||
|
||||
OM_uint32 _gsskrb5_inquire_sec_context_by_oid
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_inquire_sec_context_by_oid
|
||||
(OM_uint32 *minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
const gss_OID desired_object,
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gsskrb5_pseudo_random(OM_uint32 *minor_status,
|
||||
gss_ctx_id_t context_handle,
|
||||
int prf_key,
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_process_context_token (
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_process_context_token (
|
||||
OM_uint32 *minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
const gss_buffer_t token_buffer
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_release_cred
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_release_cred
|
||||
(OM_uint32 * minor_status,
|
||||
gss_cred_id_t * cred_handle
|
||||
)
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32 _gsskrb5_release_name
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_release_name
|
||||
(OM_uint32 * minor_status,
|
||||
gss_name_t * input_name
|
||||
)
|
||||
|
@ -33,18 +33,13 @@
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
/* 1.2.752.43.13.17 */
|
||||
static gss_OID_desc gss_krb5_cred_no_ci_flags_x_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_cred_no_ci_flags_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x11")};
|
||||
|
||||
gss_OID GSS_KRB5_CRED_NO_CI_FLAGS_X = &gss_krb5_cred_no_ci_flags_x_oid_desc;
|
||||
|
||||
/* 1.2.752.43.13.18 */
|
||||
static gss_OID_desc gss_krb5_import_cred_x_oid_desc =
|
||||
gss_OID_desc GSSAPI_LIB_VARIABLE __gss_krb5_import_cred_x_oid_desc =
|
||||
{6, rk_UNCONST("\x2a\x85\x70\x2b\x0d\x12")};
|
||||
|
||||
gss_OID GSS_KRB5_IMPORT_CRED_X = &gss_krb5_import_cred_x_oid_desc;
|
||||
|
||||
|
||||
|
||||
static OM_uint32
|
||||
import_cred(OM_uint32 *minor_status,
|
||||
@ -230,7 +225,7 @@ no_ci_flags(OM_uint32 *minor_status,
|
||||
}
|
||||
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gsskrb5_set_cred_option
|
||||
(OM_uint32 *minor_status,
|
||||
gss_cred_id_t *cred_handle,
|
||||
|
@ -98,7 +98,7 @@ set_int32(OM_uint32 *minor_status,
|
||||
return GSS_S_COMPLETE;
|
||||
}
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gsskrb5_set_sec_context_option
|
||||
(OM_uint32 *minor_status,
|
||||
gss_ctx_id_t *context_handle,
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "gsskrb5_locl.h"
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gsskrb5_store_cred(OM_uint32 *minor_status,
|
||||
gss_cred_id_t input_cred_handle,
|
||||
gss_cred_usage_t cred_usage,
|
||||
|
@ -379,7 +379,7 @@ unwrap_des3
|
||||
return GSS_S_COMPLETE;
|
||||
}
|
||||
|
||||
OM_uint32 _gsskrb5_unwrap
|
||||
OM_uint32 GSSAPI_CALLCONV _gsskrb5_unwrap
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
const gss_buffer_t input_message_buffer,
|
||||
|
@ -327,7 +327,7 @@ _gsskrb5_verify_mic_internal
|
||||
return ret;
|
||||
}
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gsskrb5_verify_mic
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
|
@ -134,7 +134,7 @@ sub_wrap_size (
|
||||
return GSS_S_COMPLETE;
|
||||
}
|
||||
|
||||
OM_uint32
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gsskrb5_wrap_size_limit (
|
||||
OM_uint32 * minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
@ -524,7 +524,8 @@ wrap_des3
|
||||
return GSS_S_COMPLETE;
|
||||
}
|
||||
|
||||
OM_uint32 _gsskrb5_wrap
|
||||
OM_uint32 GSSAPI_CALLCONV
|
||||
_gsskrb5_wrap
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
int conf_req_flag,
|
||||
|
@ -141,7 +141,8 @@ choose_mech(const gss_buffer_t input, gss_OID mech_oid)
|
||||
}
|
||||
|
||||
|
||||
OM_uint32 gss_accept_sec_context(OM_uint32 *minor_status,
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_accept_sec_context(OM_uint32 *minor_status,
|
||||
gss_ctx_id_t *context_handle,
|
||||
const gss_cred_id_t acceptor_cred_handle,
|
||||
const gss_buffer_t input_token,
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_acquire_cred(OM_uint32 *minor_status,
|
||||
const gss_name_t desired_name,
|
||||
OM_uint32 time_req,
|
||||
|
@ -70,7 +70,7 @@ _gss_copy_cred(struct _gss_mechanism_cred *mc)
|
||||
return (new_mc);
|
||||
}
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_add_cred(OM_uint32 *minor_status,
|
||||
const gss_cred_id_t input_cred_handle,
|
||||
const gss_name_t desired_name,
|
||||
|
@ -51,7 +51,7 @@
|
||||
* @ingroup gssapi
|
||||
*/
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_add_oid_set_member (OM_uint32 * minor_status,
|
||||
const gss_OID member_oid,
|
||||
gss_OID_set * oid_set)
|
||||
|
@ -43,7 +43,7 @@
|
||||
*/
|
||||
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_wrap_iov(OM_uint32 * minor_status,
|
||||
gss_ctx_id_t context_handle,
|
||||
int conf_req_flag,
|
||||
@ -81,7 +81,7 @@ gss_wrap_iov(OM_uint32 * minor_status,
|
||||
* @ingroup gssapi
|
||||
*/
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_unwrap_iov(OM_uint32 *minor_status,
|
||||
gss_ctx_id_t context_handle,
|
||||
int *conf_state,
|
||||
@ -124,7 +124,7 @@ gss_unwrap_iov(OM_uint32 *minor_status,
|
||||
* @ingroup gssapi
|
||||
*/
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_wrap_iov_length(OM_uint32 * minor_status,
|
||||
gss_ctx_id_t context_handle,
|
||||
int conf_req_flag,
|
||||
@ -162,7 +162,7 @@ gss_wrap_iov_length(OM_uint32 * minor_status,
|
||||
* @ingroup gssapi
|
||||
*/
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_release_iov_buffer(OM_uint32 *minor_status,
|
||||
gss_iov_buffer_desc *iov,
|
||||
int iov_count)
|
||||
@ -194,13 +194,10 @@ gss_release_iov_buffer(OM_uint32 *minor_status,
|
||||
* @ingroup gssapi
|
||||
*/
|
||||
|
||||
static gss_OID_desc gss_c_attr_stream_sizes_desc =
|
||||
gss_OID_desc GSSAPI_LIB_FUNCTION __gss_c_attr_stream_sizes_oid_desc =
|
||||
{10, rk_UNCONST("\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03")};
|
||||
|
||||
gss_OID GSSAPI_LIB_VARIABLE GSS_C_ATTR_STREAM_SIZES =
|
||||
&gss_c_attr_stream_sizes_desc;
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_context_query_attributes(OM_uint32 *minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
const gss_OID attribute,
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_create_empty_buffer_set
|
||||
(OM_uint32 * minor_status,
|
||||
gss_buffer_set_t *buffer_set)
|
||||
@ -54,7 +54,7 @@ gss_create_empty_buffer_set
|
||||
return GSS_S_COMPLETE;
|
||||
}
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_add_buffer_set_member
|
||||
(OM_uint32 * minor_status,
|
||||
const gss_buffer_t member_buffer,
|
||||
@ -96,7 +96,7 @@ gss_add_buffer_set_member
|
||||
return GSS_S_COMPLETE;
|
||||
}
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_release_buffer_set(OM_uint32 * minor_status,
|
||||
gss_buffer_set_t *buffer_set)
|
||||
{
|
||||
|
@ -52,7 +52,7 @@
|
||||
* @ingroup gssapi
|
||||
*/
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_canonicalize_name(OM_uint32 *minor_status,
|
||||
const gss_name_t input_name,
|
||||
const gss_OID mech_type,
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_compare_name(OM_uint32 *minor_status,
|
||||
const gss_name_t name1_arg,
|
||||
const gss_name_t name2_arg,
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_context_time(OM_uint32 *minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
OM_uint32 *time_rec)
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_create_empty_oid_set(OM_uint32 *minor_status,
|
||||
gss_OID_set *oid_set)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@
|
||||
* cred-data char * (not alligned)
|
||||
*/
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_export_cred(OM_uint32 * minor_status,
|
||||
gss_cred_id_t cred_handle,
|
||||
gss_buffer_t token)
|
||||
@ -107,7 +107,7 @@ gss_export_cred(OM_uint32 * minor_status,
|
||||
return GSS_S_COMPLETE;
|
||||
}
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_import_cred(OM_uint32 * minor_status,
|
||||
gss_buffer_t token,
|
||||
gss_cred_id_t * cred_handle)
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_decapsulate_token(const gss_buffer_t input_token,
|
||||
const gss_OID oid,
|
||||
gss_buffer_t output_token)
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_delete_sec_context(OM_uint32 *minor_status,
|
||||
gss_ctx_id_t *context_handle,
|
||||
gss_buffer_t output_token)
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_display_name(OM_uint32 *minor_status,
|
||||
const gss_name_t input_name,
|
||||
gss_buffer_t output_name_buffer,
|
||||
|
@ -135,7 +135,7 @@ supplementary_error(OM_uint32 v)
|
||||
}
|
||||
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_display_status(OM_uint32 *minor_status,
|
||||
OM_uint32 status_value,
|
||||
int status_type,
|
||||
@ -160,17 +160,18 @@ gss_display_status(OM_uint32 *minor_status,
|
||||
*minor_status = 0;
|
||||
switch (status_type) {
|
||||
case GSS_C_GSS_CODE: {
|
||||
char *buf;
|
||||
char *buf = NULL;
|
||||
int e;
|
||||
|
||||
if (GSS_SUPPLEMENTARY_INFO(status_value))
|
||||
asprintf(&buf, "%s", supplementary_error(
|
||||
e = asprintf(&buf, "%s", supplementary_error(
|
||||
GSS_SUPPLEMENTARY_INFO(status_value)));
|
||||
else
|
||||
asprintf (&buf, "%s %s",
|
||||
e = asprintf (&buf, "%s %s",
|
||||
calling_error(GSS_CALLING_ERROR(status_value)),
|
||||
routine_error(GSS_ROUTINE_ERROR(status_value)));
|
||||
|
||||
if (buf == NULL)
|
||||
if (e < 0 || buf == NULL)
|
||||
break;
|
||||
|
||||
status_string->length = strlen(buf);
|
||||
@ -181,21 +182,22 @@ gss_display_status(OM_uint32 *minor_status,
|
||||
case GSS_C_MECH_CODE: {
|
||||
OM_uint32 maj_junk, min_junk;
|
||||
gss_buffer_desc oid;
|
||||
char *buf;
|
||||
char *buf = NULL;
|
||||
int e;
|
||||
|
||||
maj_junk = gss_oid_to_str(&min_junk, mech_type, &oid);
|
||||
if (maj_junk != GSS_S_COMPLETE) {
|
||||
oid.value = rk_UNCONST("unknown");
|
||||
oid.length = 7;
|
||||
}
|
||||
|
||||
asprintf (&buf, "unknown mech-code %lu for mech %.*s",
|
||||
|
||||
e = asprintf (&buf, "unknown mech-code %lu for mech %.*s",
|
||||
(unsigned long)status_value,
|
||||
(int)oid.length, (char *)oid.value);
|
||||
if (maj_junk == GSS_S_COMPLETE)
|
||||
gss_release_buffer(&min_junk, &oid);
|
||||
|
||||
if (buf == NULL)
|
||||
if (e < 0 || buf == NULL)
|
||||
break;
|
||||
|
||||
status_string->length = strlen(buf);
|
||||
|
@ -28,7 +28,8 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 gss_duplicate_name(OM_uint32 *minor_status,
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_duplicate_name(OM_uint32 *minor_status,
|
||||
const gss_name_t src_name,
|
||||
gss_name_t *dest_name)
|
||||
{
|
||||
|
@ -33,7 +33,8 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 gss_duplicate_oid (
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_duplicate_oid (
|
||||
OM_uint32 *minor_status,
|
||||
gss_OID src_oid,
|
||||
gss_OID *dest_oid
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_encapsulate_token(const gss_buffer_t input_token,
|
||||
const gss_OID oid,
|
||||
gss_buffer_t output_token)
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_export_name(OM_uint32 *minor_status,
|
||||
const gss_name_t input_name,
|
||||
gss_buffer_t exported_name)
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_export_sec_context(OM_uint32 *minor_status,
|
||||
gss_ctx_id_t *context_handle,
|
||||
gss_buffer_t interprocess_token)
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_get_mic(OM_uint32 *minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
gss_qop_t qop_req,
|
||||
|
@ -163,7 +163,7 @@ _gss_import_export_name(OM_uint32 *minor_status,
|
||||
* @ingroup gssapi
|
||||
*/
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_import_name(OM_uint32 *minor_status,
|
||||
const gss_buffer_t input_name_buffer,
|
||||
const gss_OID input_name_type,
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_import_sec_context(OM_uint32 *minor_status,
|
||||
const gss_buffer_t interprocess_token,
|
||||
gss_ctx_id_t *context_handle)
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_indicate_mechs(OM_uint32 *minor_status,
|
||||
gss_OID_set *mech_set)
|
||||
{
|
||||
|
@ -55,6 +55,10 @@ _gss_mech_cred_find(gss_cred_id_t cred_handle, gss_OID mech_type)
|
||||
*
|
||||
* @param minor_status minor status code.
|
||||
*
|
||||
* @param initiator_cred_handle the credential to use when building
|
||||
* the context, if GSS_C_NO_CREDENTIAL is passed, the default
|
||||
* credential for the mechanism will be used.
|
||||
*
|
||||
* @param context_handle a pointer to a context handle, will be
|
||||
* returned as long as there is not an error.
|
||||
*
|
||||
@ -69,7 +73,7 @@ _gss_mech_cred_find(gss_cred_id_t cred_handle, gss_OID mech_type)
|
||||
* section.
|
||||
*
|
||||
* @param req_flags flags using when building the context, see @ref
|
||||
* gssapi_context_ flags
|
||||
* gssapi_context_flags
|
||||
*
|
||||
* @param time_req time requested this context should be valid in
|
||||
* seconds, common used value is GSS_C_INDEFINITE
|
||||
@ -101,7 +105,7 @@ _gss_mech_cred_find(gss_cred_id_t cred_handle, gss_OID mech_type)
|
||||
|
||||
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_init_sec_context(OM_uint32 * minor_status,
|
||||
const gss_cred_id_t initiator_cred_handle,
|
||||
gss_ctx_id_t * context_handle,
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_inquire_context(OM_uint32 *minor_status,
|
||||
const gss_ctx_id_t context_handle,
|
||||
gss_name_t *src_name,
|
||||
|
@ -42,7 +42,7 @@ updateusage(gss_cred_usage_t usage, int *usagemask)
|
||||
*usagemask |= IUSAGE;
|
||||
}
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_inquire_cred(OM_uint32 *minor_status,
|
||||
const gss_cred_id_t cred_handle,
|
||||
gss_name_t *name_ret,
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_inquire_cred_by_mech(OM_uint32 *minor_status,
|
||||
const gss_cred_id_t cred_handle,
|
||||
const gss_OID mech_type,
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
#include "mech_locl.h"
|
||||
|
||||
OM_uint32 GSSAPI_LIB_FUNCTION
|
||||
GSSAPI_LIB_FUNCTION OM_uint32 GSSAPI_LIB_CALL
|
||||
gss_inquire_cred_by_oid (OM_uint32 *minor_status,
|
||||
const gss_cred_id_t cred_handle,
|
||||
const gss_OID desired_object,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user