*commentptr = commentp ? dupstr(commentp) : NULL;
*blob = rsa_public_blob(&key, bloblen);
freersakey(&key);
+ sfree(line);
+ fclose(fp);
return 1;
not_public_either:
ret = snew(struct ssh2_userkey);
ret->alg = alg;
ret->comment = comment;
- ret->data = alg->createkey(public_blob, public_blob_len,
+ ret->data = alg->createkey(alg, public_blob, public_blob_len,
private_blob, private_blob_len);
if (!ret->data) {
sfree(ret);
}
*q = '\0';
+ sfree(comment); /* *just* in case of multiple Comment headers */
comment = dupstr(line);
} else if (!strcmp(line, "Subject") ||
!strncmp(line, "x-", 2)) {
*commentptr = comment;
else
sfree(comment);
+ sfree(line);
return pubblob;
error:
int passlen;
int cipherblk;
int i;
- char *cipherstr;
+ const char *cipherstr;
unsigned char priv_mac[20];
/*
*/
alg = find_pubkey_alg_len(alglen, algstr);
if (alg) {
- int bits = alg->pubkey_bits(blob, bloblen);
+ int bits = alg->pubkey_bits(alg, blob, bloblen);
return dupprintf("%.*s %d %s", alglen, algstr,
bits, fingerprint_str);
} else {
* Convert the type word to a string, for `wrong type' error
* messages.
*/
-char *key_type_to_str(int type)
+const char *key_type_to_str(int type)
{
switch (type) {
case SSH_KEYTYPE_UNOPENABLE: return "unable to open file"; break;