Merge pull request #131 from viktorTarasov/feature/utils/log-skey

utils: log symmetric key
This commit is contained in:
Peter Hamilton 2016-02-17 13:00:53 -05:00
commit 5eb1625a23
1 changed files with 8 additions and 0 deletions

View File

@ -468,6 +468,8 @@ def log_secret(logger, secret_type, secret_value):
log_private_key(logger, secret_value) log_private_key(logger, secret_value)
elif secret_type is ObjectType.PUBLIC_KEY: elif secret_type is ObjectType.PUBLIC_KEY:
log_public_key(logger, secret_value) log_public_key(logger, secret_value)
elif secret_type is ObjectType.SYMMETRIC_KEY:
log_symmetric_key(logger, secret_value)
else: else:
logger.info('generic secret: {0}'.format(secret_value)) logger.info('generic secret: {0}'.format(secret_value))
@ -492,6 +494,12 @@ def log_private_key(logger, private_key):
log_key_block(logger, key_block) log_key_block(logger, key_block)
def log_symmetric_key(logger, skey):
key_block = skey.key_block
log_key_block(logger, key_block)
def log_key_block(logger, key_block): def log_key_block(logger, key_block):
if key_block is not None: if key_block is not None:
logger.info('key block:') logger.info('key block:')