[roland@Turtle:~] % clear;export TREZOR_GPG_USER_ID="Roland Planitz <[email protected]>"; trezor-gpg -v agent
2016-10-17 10:50:13,493 WARNING This GPG tool is still in EXPERIMENTAL mode, so please note that the API and features may change without backwards compatibility!
2016-10-17 10:50:13,512 DEBUG serving on SSH_AUTH_SOCK=/Users/roland/.gnupg/S.gpg-agent
2016-10-17 10:50:13,513 DEBUG waiting for connection on /Users/roland/.gnupg/S.gpg-agent
2016-10-17 10:50:35,369 DEBUG accepted connection on /Users/roland/.gnupg/S.gpg-agent
2016-10-17 10:50:35,389 DEBUG <- 'OK'
2016-10-17 10:50:35,390 DEBUG -> 'RESET'
2016-10-17 10:50:35,390 DEBUG <- 'OK'
2016-10-17 10:50:35,390 DEBUG -> 'OPTION ttytype=xterm'
2016-10-17 10:50:35,390 DEBUG <- 'OK'
2016-10-17 10:50:35,399 DEBUG -> 'GETINFO version'
2016-10-17 10:50:35,399 DEBUG <- 'D 2.1.15'
2016-10-17 10:50:35,399 DEBUG <- 'OK'
2016-10-17 10:50:35,400 DEBUG -> 'OPTION allow-pinentry-notify'
2016-10-17 10:50:35,400 DEBUG <- 'OK'
2016-10-17 10:50:35,400 DEBUG -> 'OPTION agent-awareness=2.1.0'
2016-10-17 10:50:35,400 DEBUG <- 'OK'
2016-10-17 10:50:35,400 DEBUG -> 'AGENT_ID'
2016-10-17 10:50:35,401 DEBUG <- 'D TREZOR'
2016-10-17 10:50:35,401 DEBUG <- 'OK'
2016-10-17 10:50:35,404 DEBUG -> 'HAVEKEY E8AAD7A22972124DB68075FD64F070D221C2FD67 D7A218E5A497B42CEF3BC9C0F33BE9C1BA4AC619'
2016-10-17 10:50:35,405 DEBUG <- 'OK'
2016-10-17 10:50:35,409 DEBUG -> 'RESET'
2016-10-17 10:50:35,409 DEBUG <- 'OK'
2016-10-17 10:50:35,410 DEBUG -> 'SIGKEY E8AAD7A22972124DB68075FD64F070D221C2FD67'
2016-10-17 10:50:35,410 DEBUG <- 'OK'
2016-10-17 10:50:35,411 DEBUG -> 'SETKEYDESC Please+enter+the+passphrase+to+unlock+the+OpenPGP+secret+key:%0A%22Roland+Planitz+<[email protected]>%22%0A256-bit+ECDSA+key,+ID+44F2BB535E654B16,%0Acreated+2016-10-16.%0A'
2016-10-17 10:50:35,411 DEBUG <- 'OK'
2016-10-17 10:50:35,412 DEBUG -> 'SETHASH 8 BF6017085070F17056E65334AAEA5FFF141CF21A69C4FB66CD45E11480618851'
2016-10-17 10:50:35,412 DEBUG <- 'OK'
2016-10-17 10:50:35,412 DEBUG -> 'PKSIGN'
2016-10-17 10:50:35,424 DEBUG prefix byte: 0b10011000
2016-10-17 10:50:35,425 DEBUG packet length: 82
2016-10-17 10:50:35,425 DEBUG parsing elliptic curve key
2016-10-17 10:50:35,426 DEBUG mpi: 4449154ddcc2460afd028cfb0224aff70342becb57f21698b042c423d0ffe8a1d74036d5ad0ad6a6d936ae2229063f440c79953a44f6eb420c76708f2839dcacd (515 bits)
2016-10-17 10:50:35,504 DEBUG key ID: 51F3833053F2E698
2016-10-17 10:50:35,504 DEBUG packet "pubkey": {'created': 1476651084, 'verifying_key': <ecdsa.keys.VerifyingKey instance at 0x1053a7cf8>, 'tag': 6, 'curve_oid': '*\x86H\xce=\x03\x01\x07', 'verifier': <function _nist256p1_verify at 0x1053bb0c8>, 'version': 4, 'algo': 19, 'key_id': 'Q\xf3\x830S\xf2\xe6\x98', 'type': 'pubkey', '_to_hash': '\x99\x00R\x04X\x03\xe8L\x13\x08*\x86H\xce=\x03\x01\x07\x02\x03\x04D\x91T\xdd\xcc$`\xaf\xd0(\xcf\xb0"J\xffp4+\xec\xb5\x7f!i\x8b\x04,B=\x0f\xfe\x8a\x1dt\x03mZ\xd0\xadjm\x93j\xe2"\x90c\xf4@\xc7\x99S\xa4On\xb4 \xc7g\x08\xf2\x83\x9d\xca\xcd'}
2016-10-17 10:50:35,504 DEBUG prefix byte: 0b10110100
2016-10-17 10:50:35,504 DEBUG packet length: 34
2016-10-17 10:50:35,505 DEBUG packet "user_id": {'tag': 13, 'type': 'user_id', 'value': 'Roland Planitz <[email protected]>', '_to_hash': '\xb4\x00\x00\x00"Roland Planitz <[email protected]>'}
2016-10-17 10:50:35,505 DEBUG prefix byte: 0b10001000
2016-10-17 10:50:35,505 DEBUG packet length: 121
2016-10-17 10:50:35,505 DEBUG packet "signature": {'hash_prefix': 'lS', 'hashed_subpackets': ['\x02X\x03\xe8L', '\x0b\t', '\x1b\x03', '\x15\x08', '\x16\x00', '\x17\x80'], 'pubkey_alg': 19, '_is_custom': True, 'hash_alg': 8, 'tag': 2, 'sig_type': 19, 'version': 4, 'sig': (102528692007018662478410427344616484795132055260561832797479366964600507666647L, 57719256278049600832974411777041248160917410385421014829423897735370847269749L), 'unhashed_subpackets': ['\x10Q\xf3\x830S\xf2\xe6\x98', 'dTREZOR-GPG'], 'type': 'signature', '_to_hash': '\x04\x13\x13\x08\x00\x15\x05\x02X\x03\xe8L\x02\x0b\t\x02\x1b\x03\x02\x15\x08\x02\x16\x00\x02\x17\x80\x04\xff\x00\x00\x00\x1b'}
2016-10-17 10:50:35,506 DEBUG prefix byte: 0b10111000
2016-10-17 10:50:35,506 DEBUG packet length: 86
2016-10-17 10:50:35,506 DEBUG parsing elliptic curve key
2016-10-17 10:50:35,507 DEBUG mpi: 408933d7028f6ad2e099f00f84c52aabfee1d5ccd6fbd051d44f057a1d6263d4188ca607f310410116a21afbd83d2e73b4f97e40d178d0904097777c846997825 (515 bits)
2016-10-17 10:50:35,575 DEBUG key ID: 6DACEBD50DF117C4
2016-10-17 10:50:35,575 DEBUG packet "subkey": {'created': 1476651084, 'verifying_key': <ecdsa.keys.VerifyingKey instance at 0x1053a7d40>, 'kdf': '\x01\x08\x07', 'tag': 14, 'curve_oid': '*\x86H\xce=\x03\x01\x07', 'verifier': <function _nist256p1_verify at 0x1049a9b18>, 'version': 4, 'algo': 18, 'key_id': 'm\xac\xeb\xd5\r\xf1\x17\xc4', 'type': 'subkey', '_to_hash': '\x99\x00V\x04X\x03\xe8L\x12\x08*\x86H\xce=\x03\x01\x07\x02\x03\x04\x08\x93=p(\xf6\xad.\t\x9f\x00\xf8LR\xaa\xbf\xee\x1d\\\xcdo\xbd\x05\x1dD\xf0W\xa1\xd6&=A\x88\xca`\x7f1\x04\x10\x11j!\xaf\xbd\x83\xd2\xe7;O\x97\xe4\r\x17\x8d\t\x04\tww\xc8F\x99x%\x03\x01\x08\x07'}
2016-10-17 10:50:35,575 DEBUG prefix byte: 0b10001000
2016-10-17 10:50:35,575 DEBUG packet length: 109
2016-10-17 10:50:35,576 DEBUG packet "signature": {'hash_prefix': '\x7f\xac', 'hashed_subpackets': ['\x02X\x03\xe8L', '\x1b\x0c'], 'pubkey_alg': 19, '_is_custom': True, 'hash_alg': 8, 'tag': 2, 'sig_type': 24, 'version': 4, 'sig': (51411217383221898020449732713403463792152212539112153765469687666398206976286L, 52574456261918540967165567050963813670579719393906417307543590784493354206261L), 'unhashed_subpackets': ['\x10Q\xf3\x830S\xf2\xe6\x98', 'dTREZOR-GPG'], 'type': 'signature', '_to_hash': '\x04\x18\x13\x08\x00\t\x05\x02X\x03\xe8L\x02\x1b\x0c\x04\xff\x00\x00\x00\x0f'}
2016-10-17 10:50:35,576 DEBUG loaded public key "Roland Planitz <[email protected]>"
2016-10-17 10:50:35,822 DEBUG nist256p1 ECDSA signature is OK (True)
2016-10-17 10:50:35,822 DEBUG GPG public key is OK
2016-10-17 10:50:35,822 DEBUG found custom pubkey
2016-10-17 10:50:35,822 DEBUG pubkey_dict: {'user_id': 'Roland Planitz <[email protected]>', '_is_custom': True, 'created': 1476651084, 'verifying_key': <ecdsa.keys.VerifyingKey instance at 0x1053a7cf8>, 'tag': 6, 'curve_oid': '*\x86H\xce=\x03\x01\x07', 'verifier': <function _nist256p1_verify at 0x1053bb0c8>, 'version': 4, 'algo': 19, 'key_id': 'Q\xf3\x830S\xf2\xe6\x98', 'type': 'pubkey', '_to_hash': '\x99\x00R\x04X\x03\xe8L\x13\x08*\x86H\xce=\x03\x01\x07\x02\x03\x04D\x91T\xdd\xcc$`\xaf\xd0(\xcf\xb0"J\xffp4+\xec\xb5\x7f!i\x8b\x04,B=\x0f\xfe\x8a\x1dt\x03mZ\xd0\xadjm\x93j\xe2"\x90c\xf4@\xc7\x99S\xa4On\xb4 \xc7g\x08\xf2\x83\x9d\xca\xcd'}
Traceback (most recent call last):
File "/usr/local/bin/trezor-gpg", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/trezor_agent/gpg/__main__.py", line 95, in main
args.run(args)
File "/usr/local/lib/python2.7/site-packages/trezor_agent/gpg/__main__.py", line 69, in run_agent
agent.handle_connection(conn)
File "/usr/local/lib/python2.7/site-packages/trezor_agent/gpg/agent.py", line 121, in handle_connection
sig = pksign(keygrip, digest, algo)
File "/usr/local/lib/python2.7/site-packages/trezor_agent/gpg/agent.py", line 47, in pksign
pubkey, conn = encode.load_from_public_key(pubkey_dict=pubkey_dict)
File "/usr/local/lib/python2.7/site-packages/trezor_agent/gpg/encode.py", line 119, in load_from_public_key
conn = device.HardwareSigner(user_id, curve_name=curve_name)
File "/usr/local/lib/python2.7/site-packages/trezor_agent/gpg/device.py", line 11, in __init__
self.client_wrapper = factory.load()
File "/usr/local/lib/python2.7/site-packages/trezor_agent/factory.py", line 248, in load
device_list.extend(device)
File "/usr/local/lib/python2.7/site-packages/trezor_agent/factory.py", line 27, in _load_client
connection = client_type(hid_transport(d))
File "/usr/local/lib/python2.7/site-packages/trezorlib/client.py", line 361, in __init__
self.init_device()
File "/usr/local/lib/python2.7/site-packages/trezorlib/client.py", line 368, in init_device
self.features = expect(proto.Features)(self.call)(proto.Initialize())
File "/usr/local/lib/python2.7/site-packages/trezorlib/client.py", line 85, in wrapped_f
ret = f(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/trezorlib/client.py", line 98, in wrapped_f
return f(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/trezorlib/client.py", line 134, in call
resp = self.call_raw(msg)
File "/usr/local/lib/python2.7/site-packages/trezorlib/client.py", line 98, in wrapped_f
return f(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/trezorlib/client.py", line 130, in call_raw
return self.transport.read_blocking()
File "/usr/local/lib/python2.7/site-packages/trezorlib/transport.py", line 68, in read_blocking
data = self._read()
File "/usr/local/lib/python2.7/site-packages/trezorlib/transport.py", line 128, in _read
(msg_type, datalen, data) = self.parse_first(chunk)
File "/usr/local/lib/python2.7/site-packages/trezorlib/transport.py", line 140, in parse_first
raise Exception("Unexpected magic characters")
Exception: Unexpected magic characters
[roland@Turtle:~] % gpg2 --export github | gpg2 --list-packets
# off=0 ctb=98 tag=6 hlen=2 plen=82
:public key packet:
version 4, algo 19, created 1476651084, expires 0
pkey[0]: [72 bits] nistp256 (1.2.840.10045.3.1.7)
pkey[1]: [515 bits]
keyid: 51F3833053F2E698
# off=84 ctb=b4 tag=13 hlen=2 plen=34
:user ID packet: "Roland Planitz <[email protected]>"
# off=120 ctb=88 tag=2 hlen=2 plen=121
:signature packet: algo 19, keyid 51F3833053F2E698
version 4, created 1476651084, md5len 0, sigclass 0x13
digest algo 8, begin of digest 6c 53
hashed subpkt 2 len 4 (sig created 2016-10-16)
hashed subpkt 11 len 1 (pref-sym-algos: 9)
hashed subpkt 27 len 1 (key flags: 03)
hashed subpkt 21 len 1 (pref-hash-algos: 8)
hashed subpkt 22 len 1 (pref-zip-algos: 0)
hashed subpkt 23 len 1 (keyserver preferences: 80)
subpkt 16 len 8 (issuer key ID 51F3833053F2E698)
subpkt 100 len 10 (experimental / private subpacket)
data: [256 bits]
data: [255 bits]
# off=243 ctb=b8 tag=14 hlen=2 plen=86
:public sub key packet:
version 4, algo 18, created 1476651084, expires 0
pkey[0]: [72 bits] nistp256 (1.2.840.10045.3.1.7)
pkey[1]: [515 bits]
pkey[2]: [32 bits]
keyid: 6DACEBD50DF117C4
# off=331 ctb=88 tag=2 hlen=2 plen=109
:signature packet: algo 19, keyid 51F3833053F2E698
version 4, created 1476651084, md5len 0, sigclass 0x18
digest algo 8, begin of digest 7f ac
hashed subpkt 2 len 4 (sig created 2016-10-16)
hashed subpkt 27 len 1 (key flags: 0C)
subpkt 16 len 8 (issuer key ID 51F3833053F2E698)
subpkt 100 len 10 (experimental / private subpacket)
data: [255 bits]
data: [255 bits]