Module: Rex::Proto::Kerberos::Crypto::Checksum

Defined in:
lib/rex/proto/kerberos/crypto.rb

Constant Summary collapse

RSA_MD5 =
7
MD5_DES =
8
SHA1_DES3 =
12
SHA1_AES128 =
15
SHA1_AES256 =
16
HMAC_MD5 =
-138

Class Method Summary collapse

Class Method Details

.from_checksum_type(ctype) ⇒ Object

Raises:

  • (::NotImplementedError)


45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/rex/proto/kerberos/crypto.rb', line 45

def self.from_checksum_type(ctype)
  checksummers = {
    RSA_MD5     => Rex::Proto::Kerberos::Crypto::RsaMd5,
    MD5_DES     => Rex::Proto::Kerberos::Crypto::DesCbcMd5,
    SHA1_DES3   => Rex::Proto::Kerberos::Crypto::Des3CbcSha1,
    SHA1_AES128 => Rex::Proto::Kerberos::Crypto::Aes128CtsSha1,
    SHA1_AES256 => Rex::Proto::Kerberos::Crypto::Aes256CtsSha1,
    HMAC_MD5    => Rex::Proto::Kerberos::Crypto::Rc4Hmac,
    0xffffff76  => Rex::Proto::Kerberos::Crypto::Rc4Hmac, # Negative 138 two's complement
  }
  result = checksummers[ctype]
  raise ::NotImplementedError, 'Checksum type is not supported' if result == nil

  result.new
end