metasploit-framework/lib/rex/proto/kerberos/credential_cache/time.rb

47 lines
945 B
Ruby
Raw Normal View History

2014-12-18 05:16:58 +00:00
module Rex
module Proto
module Kerberos
module CredentialCache
2014-12-18 06:30:47 +00:00
class Time < Element
# Fixnum
attr_accessor :auth_time
# Fixnum
attr_accessor :start_time
# Fixnum
attr_accessor :end_time
# Fixnum
attr_accessor :renew_till
def encode
encoded = ''
encoded << encode_auth_time
encoded << encode_start_time
encoded << encode_end_time
encoded << encode_renew_time
encoded
end
private
def encode_auth_time
[auth_time].pack('N')
end
def encode_start_time
[start_time].pack('N')
end
def encode_end_time
[end_time].pack('N')
end
def encode_renew_time
[renew_till].pack('N')
end
2014-12-18 05:16:58 +00:00
end
end
end
end
end