Error checking and memory leak fixes in NISTZ256.

Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
Emilia Kasper
2015-04-27 16:21:48 +02:00
parent 2f5997b7b9
commit e22d2199e2
5 changed files with 52 additions and 31 deletions

View File

@@ -102,10 +102,15 @@ BN_ULONG *bn_get_words(const BIGNUM *a);
void bn_set_static_words(BIGNUM *a, BN_ULONG *words, int size);
/*
* Copy data into the BIGNUM. The caller must check that dmax is sufficient to
* hold the data
* Copy words into the BIGNUM |a|, reallocating space as necessary.
* The negative flag of |a| is not modified.
* Returns 1 on success and 0 on failure.
*/
void bn_set_data(BIGNUM *a, const void *data, size_t size);
/*
* |num_words| is int because bn_expand2 takes an int. This is an internal
* function so we simply trust callers not to pass negative values.
*/
int bn_set_words(BIGNUM *a, BN_ULONG *words, int num_words);
size_t bn_sizeof_BIGNUM(void);