PROV: Fix bignum printout in text serializers
authorRichard Levitte <levitte@openssl.org>
Sun, 19 Jan 2020 08:04:08 +0000 (09:04 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 23 Jan 2020 16:14:39 +0000 (17:14 +0100)
commita88aef32c902b79261c53a16546f4adbf6b3a617
tree9df5335565f5c327432c55f1a0843ff3d90c086b
parent62f49b90d7e88d3c36fc1f5e4d677997aeb97b0a
PROV: Fix bignum printout in text serializers

The common routine ossl_prov_print_labeled_bignum() didn't print the
BIGNUM quite the way it should.  It treated the limbs in a big endian
fashion, when they are really organised in a little endian fashion.

Furthermore, we make it inherit the behaviour from the print of legacy
keys, where a number starting with the high bit set gets an extra zero
printed first.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10891)
providers/implementations/serializers/serializer_common.c
providers/implementations/serializers/serializer_local.h