tests,json: Add sig-notations test
authorAndre Heinecke <aheinecke@intevation.de>
Wed, 14 Nov 2018 16:56:23 +0000 (17:56 +0100)
committerAndre Heinecke <aheinecke@intevation.de>
Wed, 14 Nov 2018 16:56:23 +0000 (17:56 +0100)
* tests/json/t-sig-notations.in.json,
tests/json/t-sig-notations.out.json: New
* tests/json/Makefile.am (EXTRA_DIST): Add files.
* tests/json/t-json.c: Register it.

tests/json/Makefile.am
tests/json/t-json.c
tests/json/t-sig-notations.in.json [new file with mode: 0644]
tests/json/t-sig-notations.out.json [new file with mode: 0644]

index b4e1698..3439ff7 100644 (file)
@@ -59,6 +59,7 @@ EXTRA_DIST = initial.test final.test \
                t-keylist.in.json t-keylist.out.json \
                t-keylist-secret.in.json t-keylist-secret.out.json \
                t-sign.in.json t-sign.out.json \
+               t-sig-notations.in.json t-sig-notations.out.json \
                t-verify.in.json t-verify.out.json \
                t-version.in.json t-version.out.json
 
index 98bd862..024b255 100644 (file)
@@ -40,7 +40,7 @@ static const char*tests[] = { "t-config", "t-version",
     "t-keylist", "t-keylist-secret", "t-decrypt", "t-config-opt",
     "t-encrypt", "t-encrypt-sign", "t-sign", "t-verify",
     "t-decrypt-verify", "t-export", "t-createkey",
-    "t-export-secret-info", "t-chunking",
+    "t-export-secret-info", "t-chunking", "t-sig-notations",
     /* For these two the order is important
      * as t-import imports the deleted key from t-delete */
     "t-delete", "t-import",
diff --git a/tests/json/t-sig-notations.in.json b/tests/json/t-sig-notations.in.json
new file mode 100644 (file)
index 0000000..184f1c6
--- /dev/null
@@ -0,0 +1,4 @@
+{
+    "op": "verify",
+    "data": "-----BEGIN PGP MESSAGE-----\n\nowGbwMvMwCSoW1RzPCOz3ITxtFASQ/SbgPceiTk5+Qo+qaUlqVwd51kYBJkY+sUU\nWRb8d52wO1Hp7fs8mxCYHlYmkAaDKQ0MQKDAwF5QlJqWWlSUmqKbmpuYmaObmpec\nn5KZl+5QkF6gl5yfC6RyM3NTlUXAGrgZ+HMSS9MzQApyU71Ki0sUggtLU1OrUhV8\nU2WkMkpKCoqt9PXLy8v10vNK9fKL0vUL8nMykyv1Gbg4BWBuYP7OMN9VdOep8HTD\nKQLOd+7+Cshs6jVTfsMwT3sje7Pmui779IU/657Lb575u9z/LgA=\n=iqJ/\n-----END PGP MESSAGE-----\n\n"
+}
diff --git a/tests/json/t-sig-notations.out.json b/tests/json/t-sig-notations.out.json
new file mode 100644 (file)
index 0000000..1376b22
--- /dev/null
@@ -0,0 +1,56 @@
+{
+    "info": {
+        "is_mime":      false,
+        "signatures":   [{
+            "summary":      {
+                "sigsum":       [],
+                "valid":        false,
+                "green":        false,
+                "red":  false,
+                "revoked":      false,
+                "key-expired":  false,
+                "sig-expired":  false,
+                "key-missing":  false,
+                "crl-missing":  false,
+                "crl-too-old":  false,
+                "bad-policy":   false,
+                "sys-error":    false
+            },
+            "wrong_key_usage":      false,
+            "chain_model":  false,
+            "is_de_vs":     false,
+            "status_string":        "Success",
+            "fingerprint":  "A0FF4590BB6122EDEF6E3C542D727CC768697734",
+            "validity_string":      "unknown",
+            "pubkey_algo_name":     "DSA",
+            "hash_algo_name":       "SHA1",
+            "status_code":  0,
+            "timestamp":    1542213871,
+            "exp_timestamp":        0,
+            "pka_trust":    0,
+            "validity":     0,
+            "validity_reason":      0,
+            "notations":    [{
+                "human_readable":       false,
+                "critical":     false,
+                "value":        "https://www.gnu.org/policy/",
+                "flags":        0
+            }, {
+            "human_readable":       true,
+            "critical":     false,
+            "name": "laughing@me",
+            "value":        "Just Squeeze Me",
+            "flags":        1
+            }, {
+            "human_readable":       true,
+            "critical":     true,
+            "name": "preferred-email-encoding@pgp.com",
+            "value":        "pgpmime",
+            "flags":        3
+            }]
+        }]
+    },
+    "type": "plaintext",
+    "base64":       false,
+    "data": "Hallo Leute\n"
+}