projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
PACKET: simplify
[openssl.git]
/
test
/
ecdsatest.c
diff --git
a/test/ecdsatest.c
b/test/ecdsatest.c
index 52326c5e23b0b15fc00847714b19f05fa9794472..975486956528b6ae0a06693ed30967074311f142 100644
(file)
--- a/
test/ecdsatest.c
+++ b/
test/ecdsatest.c
@@
-107,8
+107,8
@@
int change_rand(void);
int restore_rand(void);
int fbytes(unsigned char *buf, int num);
int restore_rand(void);
int fbytes(unsigned char *buf, int num);
-RAND_METHOD fake_rand;
-const RAND_METHOD *old_rand;
+
static
RAND_METHOD fake_rand;
+
static
const RAND_METHOD *old_rand;
int change_rand(void)
{
int change_rand(void)
{
@@
-241,8
+241,7
@@
int x9_62_test_internal(BIO *out, int nid, const char *r_in, const char *s_in)
if (!ret)
BIO_printf(out, " failed\n");
EC_KEY_free(key);
if (!ret)
BIO_printf(out, " failed\n");
EC_KEY_free(key);
- if (signature)
- ECDSA_SIG_free(signature);
+ ECDSA_SIG_free(signature);
BN_free(r);
BN_free(s);
EVP_MD_CTX_cleanup(&md_ctx);
BN_free(r);
BN_free(s);
EVP_MD_CTX_cleanup(&md_ctx);
@@
-319,9
+318,7
@@
int test_builtin(BIO *out)
/* get a list of all internal curves */
crv_len = EC_get_builtin_curves(NULL, 0);
/* get a list of all internal curves */
crv_len = EC_get_builtin_curves(NULL, 0);
-
- curves = OPENSSL_malloc(sizeof(EC_builtin_curve) * crv_len);
-
+ curves = OPENSSL_malloc(sizeof(*curves) * crv_len);
if (curves == NULL) {
BIO_printf(out, "malloc error\n");
goto builtin_err;
if (curves == NULL) {
BIO_printf(out, "malloc error\n");
goto builtin_err;
@@
-443,10
+440,8
@@
int test_builtin(BIO *out)
goto builtin_err;
}
buf_len = 2 * bn_len;
goto builtin_err;
}
buf_len = 2 * bn_len;
- if ((raw_buf = OPENSSL_
m
alloc(buf_len)) == NULL)
+ if ((raw_buf = OPENSSL_
z
alloc(buf_len)) == NULL)
goto builtin_err;
goto builtin_err;
- /* Pad the bignums with leading zeroes. */
- memset(raw_buf, 0, buf_len);
BN_bn2bin(ecdsa_sig->r, raw_buf + bn_len - r_len);
BN_bn2bin(ecdsa_sig->s, raw_buf + buf_len - s_len);
BN_bn2bin(ecdsa_sig->r, raw_buf + bn_len - r_len);
BN_bn2bin(ecdsa_sig->s, raw_buf + buf_len - s_len);
@@
-502,8
+497,7
@@
int test_builtin(BIO *out)
builtin_err:
EC_KEY_free(eckey);
EC_KEY_free(wrong_eckey);
builtin_err:
EC_KEY_free(eckey);
EC_KEY_free(wrong_eckey);
- if (ecdsa_sig)
- ECDSA_SIG_free(ecdsa_sig);
+ ECDSA_SIG_free(ecdsa_sig);
OPENSSL_free(signature);
OPENSSL_free(raw_buf);
OPENSSL_free(curves);
OPENSSL_free(signature);
OPENSSL_free(raw_buf);
OPENSSL_free(curves);
@@
-516,7
+510,7
@@
int main(void)
int ret = 1;
BIO *out;
int ret = 1;
BIO *out;
- out = BIO_new_fp(stdout, BIO_NOCLOSE);
+ out = BIO_new_fp(stdout, BIO_NOCLOSE
| BIO_FP_TEXT
);
/* enable memory leak checking unless explicitly disabled */
if (!((getenv("OPENSSL_DEBUG_MEMORY") != NULL) &&
/* enable memory leak checking unless explicitly disabled */
if (!((getenv("OPENSSL_DEBUG_MEMORY") != NULL) &&