diff options
author | Andreas Schneider <asn@samba.org> | 2016-08-29 11:29:34 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2016-08-31 20:59:16 +0200 |
commit | c0e861666911d84f2d78cdab370077d9ac192005 (patch) | |
tree | eda3444c5644932e970ef5a2285c08804517411d /lib/krb5_wrap | |
parent | 466ebd4911dceac66ce379f6bd7e59881d0325f5 (diff) | |
download | samba-c0e861666911d84f2d78cdab370077d9ac192005.tar.gz |
krb5_wrap: Add MIT implmentation of smb_krb5_keyblock_init_contents()
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/krb5_wrap')
-rw-r--r-- | lib/krb5_wrap/krb5_samba.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/krb5_wrap/krb5_samba.c b/lib/krb5_wrap/krb5_samba.c index a28580b1221..06f144971f9 100644 --- a/lib/krb5_wrap/krb5_samba.c +++ b/lib/krb5_wrap/krb5_samba.c @@ -1681,6 +1681,22 @@ krb5_error_code smb_krb5_keyblock_init_contents(krb5_context context, { #if defined(HAVE_KRB5_KEYBLOCK_INIT) return krb5_keyblock_init(context, enctype, data, length, key); +#elif defined(HAVE_KRB5_INIT_KEYBLOCK) + krb5_error_code code; + + code = krb5_init_keyblock(context, + enctype, + length, + key); + if (code != 0) { + return code; + } + + if (length != 0) { + memcpy(KRB5_KEY_DATA(key), data, length); + } + + return 0; #else memset(key, 0, sizeof(krb5_keyblock)); KRB5_KEY_DATA(key) = SMB_MALLOC(length); |