mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-10 07:56:09 +00:00
zmq_curve_keypair(): return result from crypto_box_keypair() to make testcase meaningfull
This commit is contained in:
parent
da1633ebe7
commit
1dd5fef20c
@ -217,12 +217,11 @@ int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key)
|
|||||||
uint8_t public_key [32];
|
uint8_t public_key [32];
|
||||||
uint8_t secret_key [32];
|
uint8_t secret_key [32];
|
||||||
|
|
||||||
// Return codes are suppressed as none of these can actually fail.
|
int res = crypto_box_keypair (public_key, secret_key);
|
||||||
crypto_box_keypair (public_key, secret_key);
|
|
||||||
zmq_z85_encode (z85_public_key, public_key, 32);
|
zmq_z85_encode (z85_public_key, public_key, 32);
|
||||||
zmq_z85_encode (z85_secret_key, secret_key, 32);
|
zmq_z85_encode (z85_secret_key, secret_key, 32);
|
||||||
|
|
||||||
return 0;
|
return res;
|
||||||
#else
|
#else
|
||||||
(void) z85_public_key, (void) z85_secret_key;
|
(void) z85_public_key, (void) z85_secret_key;
|
||||||
errno = ENOTSUP;
|
errno = ENOTSUP;
|
||||||
|
@ -40,7 +40,6 @@ void test__zmq_curve_keypair__always__success (void)
|
|||||||
|
|
||||||
#if defined (ZMQ_HAVE_CURVE)
|
#if defined (ZMQ_HAVE_CURVE)
|
||||||
assert (rc == 0);
|
assert (rc == 0);
|
||||||
assert (zmq_errno () == 0);
|
|
||||||
#else
|
#else
|
||||||
assert (rc == -1);
|
assert (rc == -1);
|
||||||
assert (zmq_errno () == ENOTSUP);
|
assert (zmq_errno () == ENOTSUP);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user