aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/signature_test.go
diff options
context:
space:
mode:
authorPaulo Gomes <pjbgf@linux.com>2024-08-21 19:44:32 +0000
committerGitHub <noreply@github.com>2024-08-21 19:44:32 +0000
commit060f00f3e2b6fde3ca5e01227fed60d62e349fa5 (patch)
tree96b31e6ef8ed53fd0281bd7b39e4fff601d14b08 /plumbing/object/signature_test.go
parent6d583524d3e1d79c171d4666eee3e1d174c210d0 (diff)
parent9ac14c4ac7c6d1043394c0cc1be5e0c931b8f6c4 (diff)
downloadgo-git-060f00f3e2b6fde3ca5e01227fed60d62e349fa5.tar.gz
Merge pull request #1169 from yoavamit/parse-x509-signed-message
plumbing: signature, support the same x509 signature formats as git
Diffstat (limited to 'plumbing/object/signature_test.go')
-rw-r--r--plumbing/object/signature_test.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/plumbing/object/signature_test.go b/plumbing/object/signature_test.go
index 3b20cde..732aa09 100644
--- a/plumbing/object/signature_test.go
+++ b/plumbing/object/signature_test.go
@@ -33,7 +33,7 @@ MKEQruIQWJb+8HVXwssA4=
want: signatureTypeSSH,
},
{
- name: "known signature format (X509)",
+ name: "known signature format (X509) CERTIFICATE",
b: []byte(`-----BEGIN CERTIFICATE-----
MIIDZjCCAk6gAwIBAgIJALZ9Z3Z9Z3Z9MA0GCSqGSIb3DQEBCwUAMIGIMQswCQYD
VQQGEwJTRTEOMAwGA1UECAwFVGV4YXMxDjAMBgNVBAcMBVRleGFzMQ4wDAYDVQQK
@@ -46,6 +46,19 @@ ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQZ9Z3Z9Z3Z9Z3Z9Z3Z9Z3
want: signatureTypeX509,
},
{
+ name: "known signature format (x509) SIGNED MESSAGE",
+ b: []byte(`-----BEGIN SIGNED MESSAGE-----
+MIIDZjCCAk6gAwIBAgIJALZ9Z3Z9Z3Z9MA0GCSqGSIb3DQEBCwUAMIGIMQswCQYD
+VQQGEwJTRTEOMAwGA1UECAwFVGV4YXMxDjAMBgNVBAcMBVRleGFzMQ4wDAYDVQQK
+DAVUZXhhczEOMAwGA1UECwwFVGV4YXMxGDAWBgNVBAMMD1RleGFzIENlcnRpZmlj
+YXRlMB4XDTE3MDUyNjE3MjY0MloXDTI3MDUyNDE3MjY0MlowgYgxCzAJBgNVBAYT
+AlNFMQ4wDAYDVQQIDAVUZXhhczEOMAwGA1UEBwwFVGV4YXMxDjAMBgNVBAoMBVRl
+eGFzMQ4wDAYDVQQLDAVUZXhhczEYMBYGA1UEAwwPVGV4YXMgQ2VydGlmaWNhdGUw
+ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDQZ9Z3Z9Z3Z9Z3Z9Z3Z9Z3
+-----END SIGNED MESSAGE-----`),
+ want: signatureTypeX509,
+ },
+ {
name: "unknown signature format",
b: []byte(`-----BEGIN ARBITRARY SIGNATURE-----
U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgij/EfHS8tCjolj5uEANXgKzFfp