summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/gssapi/encapsulate.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/gssapi/encapsulate.c')
-rw-r--r--crypto/heimdal/lib/gssapi/encapsulate.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/crypto/heimdal/lib/gssapi/encapsulate.c b/crypto/heimdal/lib/gssapi/encapsulate.c
index e7c6750..f3cd1e4 100644
--- a/crypto/heimdal/lib/gssapi/encapsulate.c
+++ b/crypto/heimdal/lib/gssapi/encapsulate.c
@@ -33,7 +33,7 @@
#include "gssapi_locl.h"
-RCSID("$Id: encapsulate.c,v 1.6 2001/08/23 04:35:54 assar Exp $");
+RCSID("$Id: encapsulate.c,v 1.6.6.1 2003/09/18 21:47:44 lha Exp $");
void
gssapi_krb5_encap_length (size_t data_len,
@@ -72,6 +72,26 @@ gssapi_krb5_make_header (u_char *p,
return p;
}
+u_char *
+_gssapi_make_mech_header(u_char *p,
+ size_t len)
+{
+ int e;
+ size_t len_len, foo;
+
+ *p++ = 0x60;
+ len_len = length_len(len);
+ e = der_put_length (p + len_len - 1, len_len, len, &foo);
+ if(e || foo != len_len)
+ abort ();
+ p += len_len;
+ *p++ = 0x06;
+ *p++ = GSS_KRB5_MECHANISM->length;
+ memcpy (p, GSS_KRB5_MECHANISM->elements, GSS_KRB5_MECHANISM->length);
+ p += GSS_KRB5_MECHANISM->length;
+ return p;
+}
+
/*
* Give it a krb5_data and it will encapsulate with extra GSS-API wrappings.
*/
OpenPOWER on IntegriCloud