1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

python:tests: Add support to print krb5 keys as string

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Stefan Metzmacher 2022-02-11 15:46:53 +01:00 committed by Andreas Schneider
parent 887f0cf243
commit 4b684c325b

View File

@ -51,7 +51,7 @@ os.environ["PYTHONUNBUFFERED"] = "1"
from math import gcd
from functools import reduce
from struct import pack, unpack
from binascii import crc32
from binascii import crc32, b2a_hex
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives import hmac
from cryptography.hazmat.primitives.ciphers import algorithms as ciphers
@ -616,6 +616,9 @@ class Key(object):
self.enctype = enctype
self.contents = contents
def __str__(self):
return "enctype=%d contents=%s" % (self.enctype,
b2a_hex(self.contents).decode('ascii'))
def seedsize(enctype):
e = _get_enctype_profile(enctype)