diff options
Diffstat (limited to 'crypto/heimdal/lib/gssapi/wrap.c')
-rw-r--r-- | crypto/heimdal/lib/gssapi/wrap.c | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/crypto/heimdal/lib/gssapi/wrap.c b/crypto/heimdal/lib/gssapi/wrap.c index 3d282fd..4e232c5 100644 --- a/crypto/heimdal/lib/gssapi/wrap.c +++ b/crypto/heimdal/lib/gssapi/wrap.c @@ -33,7 +33,30 @@ #include "gssapi_locl.h" -RCSID("$Id: wrap.c,v 1.18 2001/05/11 09:16:47 assar Exp $"); +RCSID("$Id: wrap.c,v 1.19 2001/06/18 02:53:52 assar Exp $"); + +OM_uint32 +gss_krb5_get_localkey(const gss_ctx_id_t context_handle, + krb5_keyblock **key) +{ + krb5_keyblock *skey; + + krb5_auth_con_getlocalsubkey(gssapi_krb5_context, + context_handle->auth_context, + &skey); + if(skey == NULL) + krb5_auth_con_getremotesubkey(gssapi_krb5_context, + context_handle->auth_context, + &skey); + if(skey == NULL) + krb5_auth_con_getkey(gssapi_krb5_context, + context_handle->auth_context, + &skey); + if(skey == NULL) + return GSS_S_FAILURE; + *key = skey; + return 0; +} static OM_uint32 sub_wrap_size ( @@ -65,7 +88,7 @@ gss_wrap_size_limit ( OM_uint32 ret; krb5_keytype keytype; - ret = gss_krb5_getsomekey(context_handle, &key); + ret = gss_krb5_get_localkey(context_handle, &key); if (ret) { gssapi_krb5_set_error_string (); *minor_status = ret; @@ -162,7 +185,7 @@ wrap_des memcpy (p - 8, hash, 8); /* sequence number */ - krb5_auth_getlocalseqnumber (gssapi_krb5_context, + krb5_auth_con_getlocalseqnumber (gssapi_krb5_context, context_handle->auth_context, &seq_number); @@ -179,7 +202,7 @@ wrap_des des_cbc_encrypt ((void *)p, (void *)p, 8, schedule, (des_cblock *)(p + 8), DES_ENCRYPT); - krb5_auth_setlocalseqnumber (gssapi_krb5_context, + krb5_auth_con_setlocalseqnumber (gssapi_krb5_context, context_handle->auth_context, ++seq_number); @@ -294,7 +317,7 @@ wrap_des3 free_Checksum (&cksum); /* sequence number */ - krb5_auth_getlocalseqnumber (gssapi_krb5_context, + krb5_auth_con_getlocalseqnumber (gssapi_krb5_context, context_handle->auth_context, &seq_number); @@ -338,7 +361,7 @@ wrap_des3 memcpy (p, encdata.data, encdata.length); krb5_data_free (&encdata); - krb5_auth_setlocalseqnumber (gssapi_krb5_context, + krb5_auth_con_setlocalseqnumber (gssapi_krb5_context, context_handle->auth_context, ++seq_number); @@ -389,7 +412,7 @@ OM_uint32 gss_wrap OM_uint32 ret; krb5_keytype keytype; - ret = gss_krb5_getsomekey(context_handle, &key); + ret = gss_krb5_get_localkey(context_handle, &key); if (ret) { gssapi_krb5_set_error_string (); *minor_status = ret; |