diff options
author | Simo Sorce <idra@samba.org> | 2010-07-20 19:45:00 -0400 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2010-07-20 20:02:06 -0400 |
commit | 8137f2d7e7e69db66a5191c1a80e0bda52506528 (patch) | |
tree | 2a109174813fd3bcc88b4b1f2c06621922b718b2 | |
parent | e8460b4ebc82659d2cf1ea1588c708fa7069be5c (diff) | |
download | samba-8137f2d7e7e69db66a5191c1a80e0bda52506528.tar.gz samba-8137f2d7e7e69db66a5191c1a80e0bda52506528.tar.bz2 samba-8137f2d7e7e69db66a5191c1a80e0bda52506528.zip |
misc: cleanup get_krb5_smb_session_key()
-rw-r--r-- | source3/libsmb/clikrb5.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c index 0d79ea7063..adec435728 100644 --- a/source3/libsmb/clikrb5.c +++ b/source3/libsmb/clikrb5.c @@ -901,16 +901,20 @@ failed: return retval; } - bool get_krb5_smb_session_key(krb5_context context, krb5_auth_context auth_context, DATA_BLOB *session_key, bool remote) - { +bool get_krb5_smb_session_key(krb5_context context, + krb5_auth_context auth_context, + DATA_BLOB *session_key, bool remote) +{ krb5_keyblock *skey = NULL; krb5_error_code err = 0; bool ret = false; if (remote) { - err = krb5_auth_con_getremotesubkey(context, auth_context, &skey); + err = krb5_auth_con_getremotesubkey(context, + auth_context, &skey); } else { - err = krb5_auth_con_getlocalsubkey(context, auth_context, &skey); + err = krb5_auth_con_getlocalsubkey(context, + auth_context, &skey); } if (err || skey == NULL) { @@ -918,19 +922,22 @@ failed: goto done; } - DEBUG(10, ("Got KRB5 session key of length %d\n", (int)KRB5_KEY_LENGTH(skey))); + DEBUG(10, ("Got KRB5 session key of length %d\n", + (int)KRB5_KEY_LENGTH(skey))); + *session_key = data_blob(KRB5_KEY_DATA(skey), KRB5_KEY_LENGTH(skey)); - dump_data_pw("KRB5 Session Key:\n", session_key->data, session_key->length); + dump_data_pw("KRB5 Session Key:\n", + session_key->data, session_key->length); ret = true; - done: +done: if (skey) { krb5_free_keyblock(context, skey); } return ret; - } +} #if defined(HAVE_KRB5_PRINCIPAL_GET_COMP_STRING) && !defined(HAVE_KRB5_PRINC_COMPONENT) |