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:42:10 +0000 (10:42 +0100)
commit28ea6ad61277a498c859eea75385b28629206f50
tree9e8f036cd1660864a7b0beb9f81dfa8749221de6
parent4ae1c7771d940981ba465788266cd4fc00a304c4
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