Fix x_int64.c
authorRichard Levitte <levitte@openssl.org>
Mon, 10 Apr 2017 20:01:05 +0000 (22:01 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 11 Apr 2017 20:08:41 +0000 (22:08 +0200)
commit429223d198aabacd129cf6dde5a4203b5af41737
tree34d879e3052e401d56e80c8b9fcb2509955b6d59
parentafd7cae2713e407bce5cd7bbc47fcf9c1d7c3862
Fix x_int64.c

Clearing a misunderstanding.  The routines c2i_uint64_int() and
i2c_uint64_int() expect to receive that internal values are absolute
and with a separate sign flag, and the x_int64.c code handles values
that aren't absolute and have the sign bit embedded.  We therefore
need to convert between absolute and non-absolute values for the
encoding of negative values to be correct.

[extended tests]

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3160)
crypto/asn1/x_int64.c