/usr/share/pyshared/pyhsm/debug_cmd.py is in python-pyhsm 1.0.4f-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | """
implementations of debugging commands to execute on a YubiHSM
"""
# Copyright (c) 2011 Yubico AB
# See the file COPYING for licence statement.
import struct
__all__ = [
# constants
# functions
# classes
'YHSM_Cmd_Monitor_Exit',
]
import pyhsm.defines
from pyhsm.cmd import YHSM_Cmd
class YHSM_Cmd_Monitor_Exit(YHSM_Cmd):
"""
Send magics to YubiHSM in debug mode, and get it to exit to configuration mode again.
"""
def __init__(self, stick, payload=''):
#define YHSM_MONITOR_EXIT 0x7f // Exit to monitor (no response sent)
#define YHSM_MONITOR_EXIT_MAGIC 0xbaadbeef
# typedef struct {
# uint32_t magic; // Magic number for trigger
# uint32_t magicInv; // 1st complement of magic
# } YHSM_MONITOR_EXIT_REQ;
packed = struct.pack('<II', 0xbaadbeef, 0xffffffff - 0xbaadbeef)
YHSM_Cmd.__init__(self, stick, pyhsm.defines.YSM_MONITOR_EXIT, packed)
|