Fix error check in GOST engine
authorMatt Caswell <matt@openssl.org>
Mon, 25 May 2015 23:02:57 +0000 (00:02 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 26 May 2015 09:38:56 +0000 (10:38 +0100)
commit9cab86ee0a12d640e5698a5a1995ad1583aac214
treebb522dac523679a7388badf25bff7fe827794ec3
parente40d7c1f3a31fa614760f7a9b75ae40ece5ff8bd
Fix error check in GOST engine

The return value of i2d functions can be negative if an error occurs.
Therefore don't assign the return value to an unsigned type and *then*
check if it is negative.

RT#3862

Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 90e7cdff3aa66779486914f88333f6601f0c1cf4)
engines/ccgost/gost94_keyx.c