aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pki.c24
-rw-r--r--src/pki_crypto.c8
2 files changed, 16 insertions, 16 deletions
diff --git a/src/pki.c b/src/pki.c
index 821df576..e03844c6 100644
--- a/src/pki.c
+++ b/src/pki.c
@@ -813,7 +813,7 @@ ssh_private_key ssh_pki_convert_key_to_privatekey(const ssh_key key) {
static int pki_import_pubkey_buffer(ssh_buffer buffer,
enum ssh_keytypes_e type,
ssh_key *pkey) {
- ssh_key key;
+ ssh_key key = NULL;
int rc;
key = ssh_key_new();
@@ -828,10 +828,10 @@ static int pki_import_pubkey_buffer(ssh_buffer buffer,
switch (type) {
case SSH_KEYTYPE_DSS:
{
- ssh_string p;
- ssh_string q;
- ssh_string g;
- ssh_string pubkey;
+ ssh_string p = NULL;
+ ssh_string q = NULL;
+ ssh_string g = NULL;
+ ssh_string pubkey = NULL;
p = ssh_buffer_get_ssh_string(buffer);
if (p == NULL) {
@@ -886,8 +886,8 @@ static int pki_import_pubkey_buffer(ssh_buffer buffer,
break;
case SSH_KEYTYPE_RSA:
{
- ssh_string e;
- ssh_string n;
+ ssh_string e = NULL;
+ ssh_string n = NULL;
e = ssh_buffer_get_ssh_string(buffer);
if (e == NULL) {
@@ -918,8 +918,8 @@ static int pki_import_pubkey_buffer(ssh_buffer buffer,
#ifdef HAVE_ECC
case SSH_KEYTYPE_ECDSA:
{
- ssh_string e;
- ssh_string i;
+ ssh_string e = NULL;
+ ssh_string i = NULL;
int nid;
i = ssh_buffer_get_ssh_string(buffer);
@@ -1058,8 +1058,8 @@ fail:
int ssh_pki_import_pubkey_base64(const char *b64_key,
enum ssh_keytypes_e type,
ssh_key *pkey) {
- ssh_buffer buffer;
- ssh_string type_s;
+ ssh_buffer buffer = NULL;
+ ssh_string type_s = NULL;
int rc;
if (b64_key == NULL || pkey == NULL) {
@@ -1106,7 +1106,7 @@ int ssh_pki_import_pubkey_base64(const char *b64_key,
*/
int ssh_pki_import_pubkey_blob(const ssh_string key_blob,
ssh_key *pkey) {
- ssh_buffer buffer;
+ ssh_buffer buffer = NULL;
ssh_string type_s = NULL;
enum ssh_keytypes_e type;
int rc;
diff --git a/src/pki_crypto.c b/src/pki_crypto.c
index 082f84ff..900e1a14 100644
--- a/src/pki_crypto.c
+++ b/src/pki_crypto.c
@@ -174,8 +174,8 @@ static ssh_string make_ecpoint_string(const EC_GROUP *g,
int pki_pubkey_build_ecdsa(ssh_key key, int nid, ssh_string e)
{
- EC_POINT *p;
- const EC_GROUP *g;
+ EC_POINT *p = NULL;
+ const EC_GROUP *g = NULL;
int ok;
key->ecdsa_nid = nid;
@@ -894,7 +894,7 @@ int pki_pubkey_build_dss(ssh_key key,
ssh_string g,
ssh_string pubkey) {
int rc;
- BIGNUM *bp, *bq, *bg, *bpub_key;
+ BIGNUM *bp = NULL, *bq = NULL, *bg = NULL, *bpub_key = NULL;
key->dsa = DSA_new();
if (key->dsa == NULL) {
@@ -930,7 +930,7 @@ int pki_pubkey_build_rsa(ssh_key key,
ssh_string e,
ssh_string n) {
int rc;
- BIGNUM *be, *bn;
+ BIGNUM *be = NULL, *bn = NULL;
key->rsa = RSA_new();
if (key->rsa == NULL) {