Path: blob/master/lib/rex/proto/kerberos/model/pkinit.rb
19715 views
# -*- coding: binary -*-1require 'rasn1'23module Rex4module Proto5module Kerberos6module Model7# Contains the models for PKINIT-related ASN1 structures8# These use the RASN1 library to define the types9module Pkinit10class DomainParameters < RASN1::Model11sequence :domain_parameters,12content: [integer(:p),13integer(:g),14integer(:q),15integer(:j, optional: true),16#model(:validationParms, ValidationParms) # Not used, so not implemented17]18end1920class KdcDhKeyInfo < RASN1::Model21sequence :kdc_dh_key_info,22content: [bit_string(:subject_public_key, explicit: 0, constructed: true),23integer(:nonce, implicit: 1, constructed: true),24generalized_time(:dh_key_expiration, explicit: 2, constructed: true)25]26end2728class PkAuthenticator < RASN1::Model29sequence :pk_authenticator,30explicit: 0, constructed: true,31content: [integer(:cusec, constructed: true, explicit: 0),32generalized_time(:ctime, constructed: true, explicit: 1),33integer(:nonce, constructed: true, explicit: 2),34octet_string(:pa_checksum, constructed: true, explicit: 3, optional: true)35]36end3738class AuthPack < RASN1::Model39sequence :auth_pack,40content: [model(:pk_authenticator, PkAuthenticator),41model(:client_public_value, Rex::Proto::CryptoAsn1::X509::SubjectPublicKeyInfo),42octet_string(:client_dh_nonce, implicit: 3, constructed: true, optional: true)43]44end45end46end47end48end49end50515253