aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-05-05 17:20:54 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-05-05 17:24:53 -0400
commitbcbce97ddbee2c1cf8dd3ad1f943b8d5fe508cba (patch)
tree569e855e8a81b3b995cfadbdda8bdf46f42b2816
parent07e2bead0efc4b46cbe985057520a29a0767bb6b (diff)
downloadpatatt-bcbce97ddbee2c1cf8dd3ad1f943b8d5fe508cba.tar.gz
Samples and UI consistency tweaks
Add ed25519 and pgp signed samples. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--.keys/ed25519/kernel.org/mricon/202105051
-rw-r--r--patatt/__init__.py12
-rw-r--r--samples/ed25519-signed.txt30
-rw-r--r--samples/pgp-signed.txt30
4 files changed, 68 insertions, 5 deletions
diff --git a/.keys/ed25519/kernel.org/mricon/20210505 b/.keys/ed25519/kernel.org/mricon/20210505
new file mode 100644
index 0000000..0df0388
--- /dev/null
+++ b/.keys/ed25519/kernel.org/mricon/20210505
@@ -0,0 +1 @@
+i+0Am6o59VU+dAfK4WhkCl56BrA+rY4cXlq3AbO5M8c= \ No newline at end of file
diff --git a/patatt/__init__.py b/patatt/__init__.py
index 91c79ac..577ee25 100644
--- a/patatt/__init__.py
+++ b/patatt/__init__.py
@@ -817,7 +817,7 @@ def cmd_sign(cmdargs, config: dict) -> None:
with open(fn, 'wb') as fh:
fh.write(pm.as_bytes())
- logger.critical('SIGN: %s', os.path.basename(fn))
+ logger.critical('SIGN | %s', os.path.basename(fn))
except SigningError as ex:
logger.critical('E: %s', ex)
@@ -868,7 +868,7 @@ def validate_message(msgdata: bytes, sources: list, trim_body: bool = False) ->
signtime = pm.validate(i, pkey, trim_body=trim_body)
success = True
except ValidationError:
- errors.append('%s/%s failed to validate using a=%s, pkey=%s' % (i, s, a, keysrc))
+ errors.append('failed to validate using %s' % keysrc)
continue
goodsigs.append((i, signtime, keysrc, algo))
@@ -916,13 +916,15 @@ def cmd_validate(cmdargs, config: dict):
for identity, signtime, keysrc, algo in goodsigs:
logger.critical('PASS | %s | %s', identity, fn)
if keysrc:
- logger.info(' key: %s/%s', algo, keysrc)
+ logger.info(' | key: %s', keysrc)
else:
- logger.info(' key: default GnuPG keyring')
+ logger.info(' | key: default GnuPG keyring')
except ValidationError as ex:
allgood = False
- logger.critical('FAIL | err: %s | %s', ex, fn)
+ logger.critical('FAIL | %s | %s', ex, fn)
+ for error in ex.errors:
+ logger.critical(' | %s', error)
except RuntimeError as ex:
allgood = False
logger.critical('ERR | err: %s | %s', ex, fn)
diff --git a/samples/ed25519-signed.txt b/samples/ed25519-signed.txt
new file mode 100644
index 0000000..95bcbba
--- /dev/null
+++ b/samples/ed25519-signed.txt
@@ -0,0 +1,30 @@
+From 82d3e4a03a72b787849fd406e985f3027fa04907 Mon Sep 17 00:00:00 2001
+From: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
+Date: Wed, 5 May 2021 17:11:46 -0400
+Subject: [PATCH] Specify subset of the world
+X-Developer-Signature: v=1; a=ed25519-sha256; t=1620249230; l=403;
+ i=mricon@kernel.org; s=20210505; h=from:subject;
+ bh=aWNA6NFmS5xpRH5Gpy45nWiKCOnDOKHOYOV7Y6lyLcU=;
+ b=6eJfjTMpYzbUgSeNZf3OqQDjzFVooz6WfaEitTMIpYOWLCXRU8qCR3cjUTmLET5S8prJVMypxnZl
+ C1/hsoX8DWfyZmyquQSjCCNv2ISvZ8vEKCjXt2g0xmgK+XstajvB
+X-Developer-Key: i=mricon@kernel.org; a=ed25519;
+ pk=i+0Am6o59VU+dAfK4WhkCl56BrA+rY4cXlq3AbO5M8c=
+
+We don't want to say hello to the *whole* world, do we? Just the
+attested world, please.
+
+Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
+---
+ hello.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/hello.txt b/hello.txt
+index 18249f3..977f79b 100644
+--- a/hello.txt
++++ b/hello.txt
+@@ -1 +1 @@
+-Hello world.
++Hello attested world.
+--
+2.30.2
+
diff --git a/samples/pgp-signed.txt b/samples/pgp-signed.txt
new file mode 100644
index 0000000..98b1f2c
--- /dev/null
+++ b/samples/pgp-signed.txt
@@ -0,0 +1,30 @@
+From 82d3e4a03a72b787849fd406e985f3027fa04907 Mon Sep 17 00:00:00 2001
+From: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
+Date: Wed, 5 May 2021 17:11:46 -0400
+Subject: [PATCH] Specify subset of the world
+X-Developer-Signature: v=1; a=openpgp-sha256; l=403; h=from:subject;
+ bh=aWNA6NFmS5xpRH5Gpy45nWiKCOnDOKHOYOV7Y6lyLcU=;
+ b=owGbwMvMwCG27YjM47CUmTmMp9WSGBImc6WkxnPMSdRqXmTvUr/vDJNAxRutvTblG+aIdndskFKK
+ 9zDtKGVhEONgkBVTZCnbF7spqPChh1x6jynMHFYmkCEMXJwCMJH+Lob/MStfTr7/tPydwKmcytxN82
+ 0ObFx4Uf6ftazRnu0sKpsc3jH893rSXHbuxoXrL0SkeeN/75lzb/u39zrtrNMU9gVbqZfqcAEA
+X-Developer-Key: i=konstantin@linuxfoundation.org; a=openpgp;
+ fpr=DE0E66E32F1FDD0902666B96E63EDCA9329DD07E
+
+We don't want to say hello to the *whole* world, do we? Just the
+attested world, please.
+
+Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
+---
+ hello.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/hello.txt b/hello.txt
+index 18249f3..977f79b 100644
+--- a/hello.txt
++++ b/hello.txt
+@@ -1 +1 @@
+-Hello world.
++Hello attested world.
+--
+2.30.2
+