aboutsummaryrefslogtreecommitdiff
path: root/tests/unittests/torture_pki_ecdsa.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-08-20 17:47:11 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-08-20 18:42:03 +0200
commit6f6840a88a7852326fa7ac1d110c94b92f11f387 (patch)
treeb5eb8cac4926bb2f18b8745d8db75ec72de83817 /tests/unittests/torture_pki_ecdsa.c
parent562e579675374646f0e68c12d584f724e148ccf2 (diff)
downloadlibssh-6f6840a88a7852326fa7ac1d110c94b92f11f387.tar.gz
libssh-6f6840a88a7852326fa7ac1d110c94b92f11f387.tar.xz
libssh-6f6840a88a7852326fa7ac1d110c94b92f11f387.zip
tests: Make sure pointer are initialized in torture_pki_ecdsa
Fixes compiler warnings. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'tests/unittests/torture_pki_ecdsa.c')
-rw-r--r--tests/unittests/torture_pki_ecdsa.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/tests/unittests/torture_pki_ecdsa.c b/tests/unittests/torture_pki_ecdsa.c
index fc755e22..2e89ba4d 100644
--- a/tests/unittests/torture_pki_ecdsa.c
+++ b/tests/unittests/torture_pki_ecdsa.c
@@ -68,8 +68,8 @@ static int teardown(void **state)
static void torture_pki_ecdsa_import_privkey_base64(void **state)
{
int rc;
- char *key_str;
- ssh_key key;
+ char *key_str = NULL;
+ ssh_key key = NULL;
const char *passphrase = torture_get_testkey_passphrase();
(void) state; /* unused */
@@ -90,9 +90,9 @@ static void torture_pki_ecdsa_import_privkey_base64(void **state)
static void torture_pki_ecdsa_publickey_from_privatekey(void **state)
{
int rc;
- char *key_str;
- ssh_key key;
- ssh_key pubkey;
+ char *key_str = NULL;
+ ssh_key key = NULL;
+ ssh_key pubkey = NULL;
const char *passphrase = NULL;
(void) state; /* unused */
@@ -114,9 +114,9 @@ static void torture_pki_ecdsa_publickey_from_privatekey(void **state)
static void torture_pki_ecdsa_publickey_base64(void **state)
{
enum ssh_keytypes_e type;
- char *b64_key, *key_buf, *p;
- const char *q;
- ssh_key key;
+ char *b64_key = NULL, *key_buf = NULL, *p = NULL;
+ const char *q = NULL;
+ ssh_key key = NULL;
int rc;
(void) state; /* unused */
@@ -152,8 +152,8 @@ static void torture_pki_ecdsa_generate_pubkey_from_privkey(void **state)
{
char pubkey_original[4096] = {0};
char pubkey_generated[4096] = {0};
- ssh_key privkey;
- ssh_key pubkey;
+ ssh_key privkey = NULL;
+ ssh_key pubkey = NULL;
int rc;
int len;
@@ -194,11 +194,11 @@ static void torture_pki_ecdsa_generate_pubkey_from_privkey(void **state)
static void torture_pki_ecdsa_duplicate_key(void **state)
{
int rc;
- char *b64_key;
- char *b64_key_gen;
- ssh_key pubkey;
- ssh_key privkey;
- ssh_key privkey_dup;
+ char *b64_key = NULL;
+ char *b64_key_gen = NULL;
+ ssh_key pubkey = NULL;
+ ssh_key privkey = NULL;
+ ssh_key privkey_dup = NULL;
(void) state;
@@ -245,9 +245,9 @@ static void torture_pki_ecdsa_duplicate_key(void **state)
*/
static void torture_pki_ecdsa_duplicate_then_demote(void **state)
{
- ssh_key pubkey;
- ssh_key privkey;
- ssh_key privkey_dup;
+ ssh_key pubkey = NULL;
+ ssh_key privkey = NULL;
+ ssh_key privkey_dup = NULL;
int rc;
(void) state;
@@ -275,8 +275,8 @@ static void torture_pki_ecdsa_duplicate_then_demote(void **state)
static void torture_pki_generate_key_ecdsa(void **state)
{
int rc;
- ssh_key key;
- ssh_signature sign;
+ ssh_key key = NULL;
+ ssh_signature sign = NULL;
enum ssh_keytypes_e type = SSH_KEYTYPE_UNKNOWN;
const char *type_char = NULL;
const char *etype_char = NULL;
@@ -343,8 +343,8 @@ static void torture_pki_generate_key_ecdsa(void **state)
#ifdef HAVE_LIBCRYPTO
static void torture_pki_ecdsa_write_privkey(void **state)
{
- ssh_key origkey;
- ssh_key privkey;
+ ssh_key origkey = NULL;
+ ssh_key privkey = NULL;
int rc;
(void) state; /* unused */
@@ -420,7 +420,7 @@ static void torture_pki_ecdsa_write_privkey(void **state)
static void torture_pki_ecdsa_name(void **state, const char *expected_name)
{
int rc;
- ssh_key key;
+ ssh_key key = NULL;
const char *etype_char = NULL;
(void) state; /* unused */