View | Details | Raw Unified | Return to bug 46292 | Differences between
and this patch

Collapse All | Expand All

(-)a/services/univention-samba4/s4search-decode (+11 lines)
 Lines 48-53   from samba.ndr import ndr_print Link Here 
48
from datetime import datetime
48
from datetime import datetime
49
49
50
context = None
50
context = None
51
permitted_enctypes = []
51
52
52
keytypes = {
53
keytypes = {
53
	1: 'des_crc',
54
	1: 'des_crc',
 Lines 74-83   def decode_unicodePwd(value, kvno=0): Link Here 
74
75
75
76
76
def decode_krb5Key(value):
77
def decode_krb5Key(value):
78
	global context
79
	global permitted_enctypes
80
	if not context:
81
		context = heimdal.context()
82
	if not permitted_enctypes:
83
		for enc in context.get_permitted_enctypes():
84
			permitted_enctypes.append(enc.toint())
77
	k = binascii.a2b_base64(value)
85
	k = binascii.a2b_base64(value)
78
	(keyblock, salt, kvno) = heimdal.asn1_decode_key(k)
86
	(keyblock, salt, kvno) = heimdal.asn1_decode_key(k)
79
	enctype = keyblock.keytype()
87
	enctype = keyblock.keytype()
80
	enctype_id = enctype.toint()
88
	enctype_id = enctype.toint()
89
	if enctype_id not in permitted_enctypes:
90
		print "#\tSKIPPING ENC type %s, not support by heimdal" % enctype_id
91
		return
81
	print "#\tkrb5_keytype: %s (%d)" % (enctype, enctype_id)
92
	print "#\tkrb5_keytype: %s (%d)" % (enctype, enctype_id)
82
	key_data = keyblock.keyvalue()
93
	key_data = keyblock.keyvalue()
83
	print "#\tkeyblock: ", binascii.b2a_base64(key_data).strip()
94
	print "#\tkeyblock: ", binascii.b2a_base64(key_data).strip()

Return to bug 46292