projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
give EC_GROUP_new_by_nid a more meanigful name:
[openssl.git]
/
crypto
/
ecdsa
/
ecdsatest.c
diff --git
a/crypto/ecdsa/ecdsatest.c
b/crypto/ecdsa/ecdsatest.c
index f3371e4229b90f4ad0b8a361564f5bfd630f69a3..5315d90dd2c3d26af32c39785554b01b61e373f4 100644
(file)
--- a/
crypto/ecdsa/ecdsatest.c
+++ b/
crypto/ecdsa/ecdsatest.c
@@
-203,7
+203,7
@@
int x9_62_test_internal(BIO *out, int nid, const char *r_in, const char *s_in)
/* create the key */
if ((key = EC_KEY_new()) == NULL)
goto x962_int_err;
/* create the key */
if ((key = EC_KEY_new()) == NULL)
goto x962_int_err;
- if ((key->group = EC_GROUP_new_by_
nid
(nid)) == NULL)
+ if ((key->group = EC_GROUP_new_by_
curve_name
(nid)) == NULL)
goto x962_int_err;
if (!EC_KEY_generate_key(key))
goto x962_int_err;
goto x962_int_err;
if (!EC_KEY_generate_key(key))
goto x962_int_err;
@@
-337,7
+337,7
@@
int test_builtin(BIO *out)
/* create new ecdsa key (== EC_KEY) */
if ((eckey = EC_KEY_new()) == NULL)
goto builtin_err;
/* create new ecdsa key (== EC_KEY) */
if ((eckey = EC_KEY_new()) == NULL)
goto builtin_err;
- if ((eckey->group = EC_GROUP_new_by_
nid
(nid)) == NULL)
+ if ((eckey->group = EC_GROUP_new_by_
curve_name
(nid)) == NULL)
goto builtin_err;
if (EC_GROUP_get_degree(eckey->group) < 160)
/* drop the curve */
goto builtin_err;
if (EC_GROUP_get_degree(eckey->group) < 160)
/* drop the curve */
@@
-356,7
+356,7
@@
int test_builtin(BIO *out)
/* create second key */
if ((wrong_eckey = EC_KEY_new()) == NULL)
goto builtin_err;
/* create second key */
if ((wrong_eckey = EC_KEY_new()) == NULL)
goto builtin_err;
- if ((wrong_eckey->group = EC_GROUP_new_by_
nid
(nid)) == NULL)
+ if ((wrong_eckey->group = EC_GROUP_new_by_
curve_name
(nid)) == NULL)
goto builtin_err;
if (!EC_KEY_generate_key(wrong_eckey))
{
goto builtin_err;
if (!EC_KEY_generate_key(wrong_eckey))
{
@@
-449,7
+449,7
@@
builtin_err:
int main(void)
{
int main(void)
{
- int ret =
0
;
+ int ret =
1
;
BIO *out;
out = BIO_new_fp(stdout, BIO_NOCLOSE);
BIO *out;
out = BIO_new_fp(stdout, BIO_NOCLOSE);
@@
-477,13
+477,13
@@
int main(void)
if (!x9_62_tests(out)) goto err;
if (!test_builtin(out)) goto err;
if (!x9_62_tests(out)) goto err;
if (!test_builtin(out)) goto err;
- ret =
1
;
+ ret =
0
;
err:
err:
- if (
!ret)
+ if (
ret)
BIO_printf(out, "\nECDSA test failed\n");
else
BIO_printf(out, "\nECDSA test passed\n");
BIO_printf(out, "\nECDSA test failed\n");
else
BIO_printf(out, "\nECDSA test passed\n");
- if (
!
ret)
+ if (ret)
ERR_print_errors(out);
CRYPTO_cleanup_all_ex_data();
ERR_remove_state(0);
ERR_print_errors(out);
CRYPTO_cleanup_all_ex_data();
ERR_remove_state(0);
@@
-491,6
+491,6
@@
err:
CRYPTO_mem_leaks(out);
if (out != NULL)
BIO_free(out);
CRYPTO_mem_leaks(out);
if (out != NULL)
BIO_free(out);
- return
(0)
;
+ return
ret
;
}
#endif
}
#endif