def build_as_req(target_realm, user_name, key, current_time, nonce, pac_request=None):
req_body = build_req_body(target_realm, 'krbtgt', '', nonce, cname=user_name)
pa_ts = build_pa_enc_timestamp(current_time, key)
as_req = AsReq()
as_req['pvno'] = 5
as_req['msg-type'] = 10
as_req['padata'] = None
as_req['padata'][0] = None
as_req['padata'][0]['padata-type'] = 2
as_req['padata'][0]['padata-value'] = encode(pa_ts)
if pac_request is not None:
pa_pac_request = KerbPaPacRequest()
pa_pac_request['include-pac'] = pac_request
as_req['padata'][1] = None
as_req['padata'][1]['padata-type'] = 128
as_req['padata'][1]['padata-value'] = encode(pa_pac_request)
as_req['req-body'] = _v(4, req_body)
return as_req
评论列表
文章目录