krb5_error_code smb_krb5_get_keyinfo_from_ap_req(krb5_context context, const krb5_data *inbuf, krb5_kvno *kvno, krb5_enctype *enctype) { #ifdef HAVE_KRB5_DECODE_AP_REQ /* Heimdal */ { krb5_error_code ret; krb5_ap_req ap_req; ret = krb5_decode_ap_req(context, inbuf, &ap_req); if (ret) return ret; *kvno = get_kvno_from_ap_req(&ap_req); *enctype = get_enctype_from_ap_req(&ap_req); free_AP_REQ(&ap_req); return 0; } #endif /* Possibly not an appropriate error code. */ return KRB5KDC_ERR_BADOPTION; }
krb5_error_code smb_krb5_get_keyinfo_from_ap_req(krb5_context context, const krb5_data *inbuf, krb5_kvno *kvno, krb5_enctype *enctype) { krb5_error_code ret; #ifdef HAVE_KRB5_DECODE_AP_REQ /* Heimdal */ { krb5_ap_req ap_req; ret = krb5_decode_ap_req(context, inbuf, &ap_req); if (ret) return ret; *kvno = get_kvno_from_ap_req(&ap_req); *enctype = get_enctype_from_ap_req(&ap_req); smb_krb5_free_ap_req(context, &ap_req); } #elif defined(HAVE_DECODE_KRB5_AP_REQ) /* MIT */ { krb5_ap_req *ap_req = NULL; ret = decode_krb5_ap_req(inbuf, &ap_req); if (ret) return ret; *kvno = get_kvno_from_ap_req(ap_req); *enctype = get_enctype_from_ap_req(ap_req); smb_krb5_free_ap_req(context, ap_req); } #else #error UNKOWN_KRB5_AP_REQ_DECODING_FUNCTION #endif return ret; }