summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/x509/output.c14
-rw-r--r--tests/cert-tests/data/gost-cert.pem5
2 files changed, 16 insertions, 3 deletions
diff --git a/lib/x509/output.c b/lib/x509/output.c
index 4fc37d6253..9c9d30290f 100644
--- a/lib/x509/output.c
+++ b/lib/x509/output.c
@@ -1203,6 +1203,18 @@ print_extensions(gnutls_buffer_st * str, const char *prefix, int type,
}
}
+static void reverse_datum(gnutls_datum_t *d)
+{
+ unsigned int i;
+ unsigned char c;
+
+ for (i = 0; i < d->size / 2; i++) {
+ c = d->data[i];
+ d->data[i] = d->data[d->size - i - 1];
+ d->data[d->size - i - 1] = c;
+ }
+}
+
static void
print_pubkey(gnutls_buffer_st * str, const char *key_name,
gnutls_pubkey_t pubkey, gnutls_x509_spki_st *spki,
@@ -1428,6 +1440,8 @@ print_pubkey(gnutls_buffer_st * str, const char *key_name,
gnutls_digest_get_name(digest));
addf(str, _("\t\tParamSet: %s\n"),
gnutls_gost_paramset_get_name(param));
+ reverse_datum(&x);
+ reverse_datum(&y);
if (format ==
GNUTLS_CRT_PRINT_FULL_NUMBERS) {
adds(str, _("\t\tX: "));
diff --git a/tests/cert-tests/data/gost-cert.pem b/tests/cert-tests/data/gost-cert.pem
index 1501f83c4c..bec29b8bb5 100644
--- a/tests/cert-tests/data/gost-cert.pem
+++ b/tests/cert-tests/data/gost-cert.pem
@@ -12,9 +12,8 @@ X.509 Certificate Information:
Digest: GOSTR341194
ParamSet: CryptoPro-A
X:
- 00:e0:35:f2:a8:40:cf:ea:25:63:b5:c1:eb:fa:fd:1d
- 7f:45:d6:2a:31:96:56:35:75:25:19:f6:62:69:db:da
- eb
+ e0:35:f2:a8:40:cf:ea:25:63:b5:c1:eb:fa:fd:1d:7f
+ 45:d6:2a:31:96:56:35:75:25:19:f6:62:69:db:da:eb
Y:
57:41:b2:c1:e2:1f:7b:d0:13:c8:dd:eb:9f:ba:cb:42
a3:63:c7:0b:f4:e9:24:d7:dd:e9:34:8d:12:18:67:d8