[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-802-gcd1d7f4

Andrew Bartlett abartlet at samba.org
Tue Aug 4 21:01:05 MDT 2009


The branch, master has been updated
       via  cd1d7f4be7d31388ab79c797acaf6d7730113112 (commit)
      from  8bba340e65e84ee09a7da4d97bc7838d3eefbb15 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit cd1d7f4be7d31388ab79c797acaf6d7730113112
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Aug 5 11:25:50 2009 +1000

    s4:heimdal: import lorikeet-heimdal-200908050050 (commit 8714779fa7376fd9f7761587639e68b48afc8c9c)
    
    This also adds a new hdb-glue.c file, to cope with Heimdal's
    uncondtional enabling of SQLITE.
    
    (Very reasonable, but not required for Samba4's use).
    
    Andrew Bartlett

-----------------------------------------------------------------------

Summary of changes:
 source4/heimdal/kdc/kdc_locl.h                     |    3 +
 source4/heimdal/kdc/kerberos5.c                    |   14 +-
 source4/heimdal/kdc/misc.c                         |    8 +-
 source4/heimdal/kdc/pkinit.c                       |   20 +-
 source4/heimdal/lib/asn1/der_get.c                 |   14 +
 source4/heimdal/lib/asn1/der_put.c                 |    9 +-
 source4/heimdal/lib/asn1/krb5.asn1                 |    3 +-
 source4/heimdal/lib/asn1/main.c                    |    6 +-
 source4/heimdal/lib/gssapi/gssapi/gssapi.h         |   27 ++-
 source4/heimdal/lib/gssapi/gssapi/gssapi_krb5.h    |    8 +-
 source4/heimdal/lib/gssapi/gssapi/gssapi_spnego.h  |    8 +-
 source4/heimdal/lib/gssapi/gssapi_mech.h           |   11 +
 .../heimdal/lib/gssapi/krb5/accept_sec_context.c   |   12 +-
 source4/heimdal/lib/gssapi/krb5/acquire_cred.c     |    4 +-
 .../heimdal/lib/gssapi/krb5/canonicalize_name.c    |    2 +-
 source4/heimdal/lib/gssapi/krb5/copy_ccache.c      |   10 +-
 source4/heimdal/lib/gssapi/krb5/creds.c            |  253 ++++++++++++++++++++
 source4/heimdal/lib/gssapi/krb5/external.c         |    5 +-
 source4/heimdal/lib/gssapi/krb5/import_name.c      |   13 +-
 source4/heimdal/lib/gssapi/krb5/init_sec_context.c |    2 +-
 source4/heimdal/lib/gssapi/krb5/set_cred_option.c  |    4 +-
 source4/heimdal/lib/gssapi/krb5/store_cred.c       |  116 +++++++++
 source4/heimdal/lib/gssapi/mech/gss_aeap.c         |   16 +-
 source4/heimdal/lib/gssapi/mech/gss_cred.c         |  224 +++++++++++++++++
 source4/heimdal/lib/gssapi/mech/gss_release_name.c |   35 ++--
 source4/heimdal/lib/gssapi/spnego/cred_stubs.c     |   36 +++
 source4/heimdal/lib/gssapi/spnego/external.c       |    8 +-
 source4/heimdal/lib/hcrypto/camellia-ntt.c         |    6 +-
 source4/heimdal/lib/hcrypto/camellia.c             |    8 +-
 source4/heimdal/lib/hdb/hdb.c                      |    1 +
 source4/heimdal/lib/hdb/keytab.c                   |  171 ++++++++------
 source4/heimdal/lib/hx509/ks_file.c                |    4 +-
 source4/heimdal/lib/hx509/name.c                   |    8 +-
 source4/heimdal/lib/krb5/crypto.c                  |   13 +-
 source4/heimdal/lib/krb5/get_cred.c                |   60 ++----
 source4/heimdal/lib/krb5/kcm.c                     |    2 +-
 source4/heimdal/lib/krb5/keytab_file.c             |    2 +-
 source4/heimdal/lib/krb5/log.c                     |    7 +-
 source4/heimdal/lib/krb5/pkinit.c                  |   10 +
 source4/heimdal/lib/krb5/plugin.c                  |  200 +++++++++-------
 source4/heimdal/lib/krb5/principal.c               |   38 +++-
 source4/heimdal/lib/krb5/store_fd.c                |    2 +-
 source4/heimdal/lib/krb5/store_mem.c               |    6 +-
 source4/heimdal/lib/krb5/transited.c               |   47 ++--
 source4/heimdal/lib/krb5/warn.c                    |    6 +-
 source4/heimdal/lib/roken/base64.c                 |    5 +
 source4/heimdal/lib/roken/strpool.c                |    5 +-
 source4/heimdal/lib/roken/vis.hin                  |    9 +-
 source4/heimdal_build/hdb-glue.c                   |   35 +++
 source4/heimdal_build/internal.mk                  |    6 +-
 50 files changed, 1155 insertions(+), 367 deletions(-)
 create mode 100644 source4/heimdal/lib/gssapi/krb5/creds.c
 create mode 100644 source4/heimdal/lib/gssapi/krb5/store_cred.c
 create mode 100644 source4/heimdal/lib/gssapi/mech/gss_cred.c
 create mode 100644 source4/heimdal_build/hdb-glue.c


Changeset truncated at 500 lines:

diff --git a/source4/heimdal/kdc/kdc_locl.h b/source4/heimdal/kdc/kdc_locl.h
index daf1558..024937e 100644
--- a/source4/heimdal/kdc/kdc_locl.h
+++ b/source4/heimdal/kdc/kdc_locl.h
@@ -67,6 +67,9 @@ extern const struct units _kdc_digestunits[];
 extern struct timeval _kdc_now;
 #define kdc_time (_kdc_now.tv_sec)
 
+extern char *runas_string;
+extern char *chroot_string;
+
 void
 loop(krb5_context context, krb5_kdc_configuration *config);
 
diff --git a/source4/heimdal/kdc/kerberos5.c b/source4/heimdal/kdc/kerberos5.c
index 53e9f54..8edc07a 100644
--- a/source4/heimdal/kdc/kerberos5.c
+++ b/source4/heimdal/kdc/kerberos5.c
@@ -1208,19 +1208,13 @@ _kdc_as_rep(krb5_context context,
 			(unsigned)abs(kdc_time - p.patimestamp),
 			context->max_skew,
 			client_name);
-#if 1
-		/* This code is from samba, needs testing */
+
 		/*
-		 * the following is needed to make windows clients
-		 * to retry using the timestamp in the error message
-		 *
-		 * this is maybe a bug in windows to not trying when e_text
-		 * is present...
+		 * The following is needed to make windows clients to
+		 * retry using the timestamp in the error message, if
+		 * there is a e_text, they become unhappy.
 		 */
 		e_text = NULL;
-#else
-		e_text = "Too large time skew";
-#endif
 		goto out;
 	    }
 	    et.flags.pre_authent = 1;
diff --git a/source4/heimdal/kdc/misc.c b/source4/heimdal/kdc/misc.c
index 247cb57..e016183 100644
--- a/source4/heimdal/kdc/misc.c
+++ b/source4/heimdal/kdc/misc.c
@@ -65,12 +65,15 @@ _kdc_db_fetch(krb5_context context,
 				       "malformed request: "
 				       "enterprise name with %d name components",
 				       principal->name.name_string.len);
+		free(ent);
 		return ret;
 	    }
 	    ret = krb5_parse_name(context, principal->name.name_string.val[0],
 				  &enterprise_principal);
-	    if (ret)
+	    if (ret) {
+		free(ent);
 		return ret;
+	    }
 
 	    principal = enterprise_principal;
 	}
@@ -98,7 +101,8 @@ _kdc_db_fetch(krb5_context context,
 	}
     }
     free(ent);
-    krb5_set_error_message(context, HDB_ERR_NOENTRY, "no such entry found in hdb");
+    krb5_set_error_message(context, HDB_ERR_NOENTRY,
+			   "no such entry found in hdb");
     return HDB_ERR_NOENTRY;
 }
 
diff --git a/source4/heimdal/kdc/pkinit.c b/source4/heimdal/kdc/pkinit.c
index 644eae0..0d00ef2 100644
--- a/source4/heimdal/kdc/pkinit.c
+++ b/source4/heimdal/kdc/pkinit.c
@@ -284,7 +284,7 @@ generate_dh_keyblock(krb5_context context,
 	dh_gen_keylen = ECDH_compute_key(dh_gen_key, size, 
 					 EC_KEY_get0_public_key(client_params->u.ecdh.public_key),
 					 client_params->u.ecdh.key, NULL);
-	ret = 0;
+
 #endif /* HAVE_OPENSSL */
     } else {
 	ret = KRB5KRB_ERR_GENERIC;
@@ -1450,8 +1450,10 @@ _kdc_pk_mk_pa_reply(krb5_context context,
 
 	ret = krb5_generate_random_keyblock(context, sessionetype, 
 					    sessionkey);
-	if (ret)
+	if (ret) {
+	    free(buf);
 	    goto out;
+	}
 
     } else
 	krb5_abortx(context, "PK-INIT internal error");
@@ -1981,12 +1983,14 @@ _kdc_pk_initialize(krb5_context context,
 		hx509_name name;
 		char *str;
 		ret = hx509_cert_get_subject(cert, &name);
-		hx509_name_to_string(name, &str);
-		krb5_warnx(context, "WARNING Found KDC certificate (%s)"
-			   "is missing the PK-INIT KDC EKU, this is bad for "
-			   "interoperability.", str);
-		hx509_name_free(&name);
-		free(str);
+		if (ret == 0) {
+		    hx509_name_to_string(name, &str);
+		    krb5_warnx(context, "WARNING Found KDC certificate (%s)"
+			       "is missing the PK-INIT KDC EKU, this is bad for "
+			       "interoperability.", str);
+		    hx509_name_free(&name);
+		    free(str);
+		}
 	    }
 	    hx509_cert_free(cert);
 	} else
diff --git a/source4/heimdal/lib/asn1/der_get.c b/source4/heimdal/lib/asn1/der_get.c
index 8144639..aee5650 100644
--- a/source4/heimdal/lib/asn1/der_get.c
+++ b/source4/heimdal/lib/asn1/der_get.c
@@ -198,6 +198,13 @@ der_get_bmp_string (const unsigned char *p, size_t len,
     for (i = 0; i < data->length; i++) {
 	data->data[i] = (p[0] << 8) | p[1];
 	p += 2;
+	/* check for NUL in the middle of the string */
+	if (data->data[i] == 0 && i != (data->length - 1)) {
+	    free(data->data);
+	    data->data = NULL;
+	    data->length = 0;
+	    return ASN1_BAD_CHARACTER;
+	}
     }
     if (size) *size = len;
 
@@ -222,6 +229,13 @@ der_get_universal_string (const unsigned char *p, size_t len,
     for (i = 0; i < data->length; i++) {
 	data->data[i] = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
 	p += 4;
+	/* check for NUL in the middle of the string */
+	if (data->data[i] == 0 && i != (data->length - 1)) {
+	    free(data->data);
+	    data->data = NULL;
+	    data->length = 0;
+	    return ASN1_BAD_CHARACTER;
+	}
     }
     if (size) *size = len;
     return 0;
diff --git a/source4/heimdal/lib/asn1/der_put.c b/source4/heimdal/lib/asn1/der_put.c
index 7e71443..10fc002 100644
--- a/source4/heimdal/lib/asn1/der_put.c
+++ b/source4/heimdal/lib/asn1/der_put.c
@@ -165,7 +165,6 @@ der_put_general_string (unsigned char *p, size_t len,
     if (len < slen)
 	return ASN1_OVERFLOW;
     p -= slen;
-    len -= slen;
     memcpy (p+1, *str, slen);
     *size = slen;
     return 0;
@@ -200,7 +199,6 @@ der_put_bmp_string (unsigned char *p, size_t len,
     if (len / 2 < data->length)
 	return ASN1_OVERFLOW;
     p -= data->length * 2;
-    len -= data->length * 2;
     for (i = 0; i < data->length; i++) {
 	p[1] = (data->data[i] >> 8) & 0xff;
 	p[2] = data->data[i] & 0xff;
@@ -218,7 +216,6 @@ der_put_universal_string (unsigned char *p, size_t len,
     if (len / 4 < data->length)
 	return ASN1_OVERFLOW;
     p -= data->length * 4;
-    len -= data->length * 4;
     for (i = 0; i < data->length; i++) {
 	p[1] = (data->data[i] >> 24) & 0xff;
 	p[2] = (data->data[i] >> 16) & 0xff;
@@ -244,7 +241,6 @@ der_put_octet_string (unsigned char *p, size_t len,
     if (len < data->length)
 	return ASN1_OVERFLOW;
     p -= data->length;
-    len -= data->length;
     memcpy (p+1, data->data, data->length);
     *size = data->length;
     return 0;
@@ -421,8 +417,7 @@ der_put_length_and_tag (unsigned char *p, size_t len, size_t len_val,
     e = der_put_tag (p, len, class, type, tag, &l);
     if(e)
 	return e;
-    p -= l;
-    len -= l;
+
     ret += l;
     *size = ret;
     return 0;
@@ -459,7 +454,7 @@ der_put_bit_string (unsigned char *p, size_t len,
     if (len < data_size + 1)
 	return ASN1_OVERFLOW;
     p -= data_size + 1;
-    len -= data_size + 1;
+
     memcpy (p+2, data->data, data_size);
     if (data->length && (data->length % 8) != 0)
 	p[1] = 8 - (data->length % 8);
diff --git a/source4/heimdal/lib/asn1/krb5.asn1 b/source4/heimdal/lib/asn1/krb5.asn1
index 8edb0fd..7080b09 100644
--- a/source4/heimdal/lib/asn1/krb5.asn1
+++ b/source4/heimdal/lib/asn1/krb5.asn1
@@ -16,7 +16,8 @@ NAME-TYPE ::= INTEGER {
 	KRB5_NT_WELLKNOWN(11),	-- Wellknown
 	KRB5_NT_ENT_PRINCIPAL_AND_ID(-130), -- Windows 2000 UPN and SID
 	KRB5_NT_MS_PRINCIPAL(-128), -- NT 4 style name
-	KRB5_NT_MS_PRINCIPAL_AND_ID(-129) -- NT style name and SID
+	KRB5_NT_MS_PRINCIPAL_AND_ID(-129), -- NT style name and SID
+	KRB5_NT_NTLM(-1200) -- NTLM name, realm is domain
 }
 
 -- message types
diff --git a/source4/heimdal/lib/asn1/main.c b/source4/heimdal/lib/asn1/main.c
index 115c82a..5cef970 100644
--- a/source4/heimdal/lib/asn1/main.c
+++ b/source4/heimdal/lib/asn1/main.c
@@ -142,6 +142,10 @@ main(int argc, char **argv)
 	}
 
 	arg = calloc(2, sizeof(arg[0]));
+	if (arg == NULL) {
+	    perror("calloc");
+	    exit(1);
+	}
 	arg[0] = option_file;
 	arg[1] = NULL;
 	len = 1;
@@ -150,7 +154,7 @@ main(int argc, char **argv)
 	    buf[strcspn(buf, "\n\r")] = '\0';
 
 	    arg = realloc(arg, (len + 2) * sizeof(arg[0]));
-	    if (argv == NULL) {
+	    if (arg == NULL) {
 		perror("malloc");
 		exit(1);
 	    }
diff --git a/source4/heimdal/lib/gssapi/gssapi/gssapi.h b/source4/heimdal/lib/gssapi/gssapi/gssapi.h
index 9114180..6052ec8 100644
--- a/source4/heimdal/lib/gssapi/gssapi/gssapi.h
+++ b/source4/heimdal/lib/gssapi/gssapi/gssapi.h
@@ -63,6 +63,14 @@
 #endif
 #endif
 
+#ifdef __cplusplus
+#define GSSAPI_CPP_START	extern "C" {
+#define GSSAPI_CPP_END		}
+#else
+#define GSSAPI_CPP_START
+#define GSSAPI_CPP_END
+#endif
+
 /*
  * Now define the three implementation-dependent types.
  */
@@ -243,9 +251,7 @@ typedef OM_uint32 gss_qop_t;
 #define GSS_IOV_BUFFER_TYPE(_t) ((_t) & ~GSS_IOV_BUFFER_TYPE_FLAG_MASK)
 #define GSS_IOV_BUFFER_FLAGS(_t) ((_t) & GSS_IOV_BUFFER_TYPE_FLAG_MASK)
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+GSSAPI_CPP_START
 
 /*
  * The implementation must reserve static storage for a
@@ -894,8 +900,17 @@ OM_uint32 GSSAPI_LIB_FUNCTION
 gss_release_iov_buffer(OM_uint32 *, gss_iov_buffer_desc *, int);
 
 
-#ifdef __cplusplus
-}
-#endif
+OM_uint32 GSSAPI_LIB_FUNCTION
+gss_export_cred(OM_uint32 * /* minor_status */,
+		gss_cred_id_t /* cred_handle */,
+		gss_buffer_t /* cred_token */);
+
+OM_uint32 GSSAPI_LIB_FUNCTION
+gss_import_cred(OM_uint32 * /* minor_status */,
+		gss_buffer_t /* cred_token */,
+		gss_cred_id_t * /* cred_handle */);
+
+
+GSSAPI_CPP_END
 
 #endif /* GSSAPI_GSSAPI_H_ */
diff --git a/source4/heimdal/lib/gssapi/gssapi/gssapi_krb5.h b/source4/heimdal/lib/gssapi/gssapi/gssapi_krb5.h
index 0baccf5..4d004d9 100644
--- a/source4/heimdal/lib/gssapi/gssapi/gssapi_krb5.h
+++ b/source4/heimdal/lib/gssapi/gssapi/gssapi_krb5.h
@@ -38,9 +38,7 @@
 
 #include <gssapi.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+GSSAPI_CPP_START
 
 #if !defined(__GNUC__) && !defined(__attribute__)
 #define __attribute__(x)
@@ -246,8 +244,6 @@ gss_krb5_set_allowable_enctypes(OM_uint32 *minor_status,
 				OM_uint32 num_enctypes,
 				int32_t *enctypes);
 
-#ifdef __cplusplus
-}
-#endif
+GSSAPI_CPP_END
 
 #endif /* GSSAPI_SPNEGO_H_ */
diff --git a/source4/heimdal/lib/gssapi/gssapi/gssapi_spnego.h b/source4/heimdal/lib/gssapi/gssapi/gssapi_spnego.h
index 3c4869f..c5d372d 100644
--- a/source4/heimdal/lib/gssapi/gssapi/gssapi_spnego.h
+++ b/source4/heimdal/lib/gssapi/gssapi/gssapi_spnego.h
@@ -38,9 +38,7 @@
 
 #include <gssapi.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+GSSAPI_CPP_START
 
 /*
  * RFC2478, SPNEGO:
@@ -51,8 +49,6 @@ extern "C" {
 extern GSSAPI_LIB_VARIABLE gss_OID GSS_SPNEGO_MECHANISM;
 #define gss_mech_spnego GSS_SPNEGO_MECHANISM
 
-#ifdef __cplusplus
-}
-#endif
+GSSAPI_CPP_END
 
 #endif /* GSSAPI_SPNEGO_H_ */
diff --git a/source4/heimdal/lib/gssapi/gssapi_mech.h b/source4/heimdal/lib/gssapi/gssapi_mech.h
index 6470df3..206a24e 100644
--- a/source4/heimdal/lib/gssapi/gssapi_mech.h
+++ b/source4/heimdal/lib/gssapi/gssapi_mech.h
@@ -343,6 +343,15 @@ _gss_store_cred_t(OM_uint32         *minor_status,
 		  gss_OID_set       *elements_stored,
 		  gss_cred_usage_t  *cred_usage_stored);
 
+typedef OM_uint32
+_gss_export_cred_t(OM_uint32 *minor_status,
+		   gss_cred_id_t cred_handle,
+		   gss_buffer_t cred_token);
+
+typedef OM_uint32
+_gss_import_cred_t(OM_uint32 * minor_status,
+		   gss_buffer_t cred_token,
+		   gss_cred_id_t * cred_handle);
 
 
 #define GMI_VERSION 2
@@ -389,6 +398,8 @@ typedef struct gssapi_mech_interface_desc {
 	_gss_unwrap_iov_t		*gm_unwrap_iov;
 	_gss_wrap_iov_length_t		*gm_wrap_iov_length;
 	_gss_store_cred_t		*gm_store_cred;
+	_gss_export_cred_t		*gm_export_cred;
+	_gss_import_cred_t		*gm_import_cred;
 } gssapi_mech_interface_desc, *gssapi_mech_interface;
 
 gssapi_mech_interface
diff --git a/source4/heimdal/lib/gssapi/krb5/accept_sec_context.c b/source4/heimdal/lib/gssapi/krb5/accept_sec_context.c
index 8d998ed..355d1c4 100644
--- a/source4/heimdal/lib/gssapi/krb5/accept_sec_context.c
+++ b/source4/heimdal/lib/gssapi/krb5/accept_sec_context.c
@@ -170,12 +170,12 @@ gsskrb5_accept_delegated_token
 
     if (delegated_cred_handle) {
 	gsskrb5_cred handle;
-
-	ret = _gsskrb5_import_cred(minor_status,
-				   ccache,
-				   NULL,
-				   NULL,
-				   delegated_cred_handle);
+	
+	ret = _gsskrb5_krb5_import_cred(minor_status,
+					ccache,
+					NULL,
+					NULL,
+					delegated_cred_handle);
 	if (ret != GSS_S_COMPLETE)
 	    goto out;
 
diff --git a/source4/heimdal/lib/gssapi/krb5/acquire_cred.c b/source4/heimdal/lib/gssapi/krb5/acquire_cred.c
index 4f6f38e..696171d 100644
--- a/source4/heimdal/lib/gssapi/krb5/acquire_cred.c
+++ b/source4/heimdal/lib/gssapi/krb5/acquire_cred.c
@@ -339,8 +339,8 @@ OM_uint32 _gsskrb5_acquire_cred
 
     if (desired_name != GSS_C_NO_NAME) {
 
-	ret = _gsskrb5_canon_name(minor_status, context, 0, desired_name,
-				  &handle->principal);
+	ret = _gsskrb5_canon_name(minor_status, context, 0, NULL,
+				  desired_name, &handle->principal);
 	if (ret) {
 	    HEIMDAL_MUTEX_destroy(&handle->cred_id_mutex);
 	    free(handle);
diff --git a/source4/heimdal/lib/gssapi/krb5/canonicalize_name.c b/source4/heimdal/lib/gssapi/krb5/canonicalize_name.c
index 7e0c3fe..3de55d6 100644
--- a/source4/heimdal/lib/gssapi/krb5/canonicalize_name.c
+++ b/source4/heimdal/lib/gssapi/krb5/canonicalize_name.c
@@ -48,7 +48,7 @@ OM_uint32 _gsskrb5_canonicalize_name (
 
     GSSAPI_KRB5_INIT (&context);
 
-    ret = _gsskrb5_canon_name(minor_status, context, 1, input_name, &name);
+    ret = _gsskrb5_canon_name(minor_status, context, 1, NULL, input_name, &name);
     if (ret)
 	return ret;
 
diff --git a/source4/heimdal/lib/gssapi/krb5/copy_ccache.c b/source4/heimdal/lib/gssapi/krb5/copy_ccache.c
index a4b28f9..4e65fc1 100644
--- a/source4/heimdal/lib/gssapi/krb5/copy_ccache.c
+++ b/source4/heimdal/lib/gssapi/krb5/copy_ccache.c
@@ -63,11 +63,11 @@ gss_krb5_copy_ccache(OM_uint32 *minor_status,
 
 
 OM_uint32
-_gsskrb5_import_cred(OM_uint32 *minor_status,
-		     krb5_ccache id,
-		     krb5_principal keytab_principal,
-		     krb5_keytab keytab,
-		     gss_cred_id_t *cred)
+_gsskrb5_krb5_import_cred(OM_uint32 *minor_status,
+			  krb5_ccache id,
+			  krb5_principal keytab_principal,
+			  krb5_keytab keytab,
+			  gss_cred_id_t *cred)
 {
     krb5_context context;
     krb5_error_code kret;
diff --git a/source4/heimdal/lib/gssapi/krb5/creds.c b/source4/heimdal/lib/gssapi/krb5/creds.c
new file mode 100644
index 0000000..c9befe9
--- /dev/null
+++ b/source4/heimdal/lib/gssapi/krb5/creds.c
@@ -0,0 +1,253 @@
+/*
+ * Copyright (c) 2009 Kungliga Tekniska Högskolan
+ * (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:
+ *
+ * 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.
+ *
+ * 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.
+ */
+
+#include "gsskrb5_locl.h"
+
+OM_uint32
+_gsskrb5_export_cred(OM_uint32 *minor_status,
+		     gss_cred_id_t cred_handle,
+		     gss_buffer_t cred_token)
+{
+    gsskrb5_cred handle = (gsskrb5_cred)cred_handle;
+    krb5_context context;
+    krb5_error_code ret;
+    krb5_storage *sp;
+    krb5_data data, mech;
+    const char *type;
+    char *str;
+


-- 
Samba Shared Repository


More information about the samba-cvs mailing list