mirror of
https://github.com/romanz/amodem.git
synced 2026-03-31 08:06:50 +08:00
gpg: fixup lint/pep8
This commit is contained in:
@@ -285,7 +285,8 @@ def load_public_key(stream, use_custom=False):
|
|||||||
verify_digest(pubkey=pubkey, digest=digest,
|
verify_digest(pubkey=pubkey, digest=digest,
|
||||||
signature=signature['sig'], label='GPG public key')
|
signature=signature['sig'], label='GPG public key')
|
||||||
else:
|
else:
|
||||||
log.warning('public key %s cannot be verified!', util.hexlify(pubkey['key_id']))
|
log.warning('public key %s cannot be verified!',
|
||||||
|
util.hexlify(pubkey['key_id']))
|
||||||
|
|
||||||
packet = pubkey
|
packet = pubkey
|
||||||
while use_custom:
|
while use_custom:
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
"""Create GPG ECDSA signatures and public keys using TREZOR device."""
|
"""Create GPG ECDSA signatures and public keys using TREZOR device."""
|
||||||
import hashlib
|
|
||||||
import logging
|
import logging
|
||||||
import struct
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from . import agent, decode, proto
|
from . import agent, decode, proto
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ def run_create(args):
|
|||||||
"""Generate a new pubkey for a new/existing GPG identity."""
|
"""Generate a new pubkey for a new/existing GPG identity."""
|
||||||
user_id = os.environ['TREZOR_GPG_USER_ID']
|
user_id = os.environ['TREZOR_GPG_USER_ID']
|
||||||
f = encode.Factory(user_id=user_id, created=args.time,
|
f = encode.Factory(user_id=user_id, created=args.time,
|
||||||
curve_name=args.ecdsa_curve)
|
curve_name=args.ecdsa_curve)
|
||||||
|
|
||||||
with contextlib.closing(f):
|
with contextlib.closing(f):
|
||||||
if args.subkey:
|
if args.subkey:
|
||||||
@@ -33,7 +33,8 @@ def run_create(args):
|
|||||||
def run_sign(args):
|
def run_sign(args):
|
||||||
"""Generate a GPG signature using hardware-based device."""
|
"""Generate a GPG signature using hardware-based device."""
|
||||||
pubkey = decode.load_from_gpg(user_id=None, use_custom=True)
|
pubkey = decode.load_from_gpg(user_id=None, use_custom=True)
|
||||||
f = encode.Factory.from_public_key(pubkey=pubkey, user_id=pubkey['user_id'])
|
f = encode.Factory.from_public_key(pubkey=pubkey,
|
||||||
|
user_id=pubkey['user_id'])
|
||||||
with contextlib.closing(f):
|
with contextlib.closing(f):
|
||||||
if args.filename:
|
if args.filename:
|
||||||
data = open(args.filename, 'rb').read()
|
data = open(args.filename, 'rb').read()
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import binascii
|
|||||||
import contextlib
|
import contextlib
|
||||||
import io
|
import io
|
||||||
import struct
|
import struct
|
||||||
import time
|
|
||||||
|
|
||||||
|
|
||||||
def send(conn, data):
|
def send(conn, data):
|
||||||
|
|||||||
Reference in New Issue
Block a user