mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-26 01:32:25 +00:00
Centralise creation of a host_ca structure.
This will allow the central host_ca_new function to pre-populate the structure with default values for the fields, so that once I add more options to CA configuration they can take their default values when loading a saved record from a previous PuTTY version.
This commit is contained in:
parent
619bb441ec
commit
e34e0220ab
@ -112,6 +112,8 @@ void enum_host_ca_finish(host_ca_enum *handle);
|
|||||||
host_ca *host_ca_load(const char *name);
|
host_ca *host_ca_load(const char *name);
|
||||||
char *host_ca_save(host_ca *); /* NULL on success, or dynamic error msg */
|
char *host_ca_save(host_ca *); /* NULL on success, or dynamic error msg */
|
||||||
char *host_ca_delete(const char *name); /* likewise */
|
char *host_ca_delete(const char *name); /* likewise */
|
||||||
|
|
||||||
|
host_ca *host_ca_new(void); /* initialises to default settings */
|
||||||
void host_ca_free(host_ca *);
|
void host_ca_free(host_ca *);
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
@ -643,8 +643,7 @@ host_ca *host_ca_load(const char *name)
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
host_ca *hca = snew(host_ca);
|
host_ca *hca = host_ca_new();
|
||||||
memset(hca, 0, sizeof(*hca));
|
|
||||||
hca->name = dupstr(name);
|
hca->name = dupstr(name);
|
||||||
|
|
||||||
size_t wcsize = 0;
|
size_t wcsize = 0;
|
||||||
|
@ -26,7 +26,7 @@ add_sources_from_current_dir(utils
|
|||||||
encode_utf8.c
|
encode_utf8.c
|
||||||
encode_wide_string_as_utf8.c
|
encode_wide_string_as_utf8.c
|
||||||
fgetline.c
|
fgetline.c
|
||||||
host_ca_free.c
|
host_ca_new_free.c
|
||||||
host_strchr.c
|
host_strchr.c
|
||||||
host_strchr_internal.c
|
host_strchr_internal.c
|
||||||
host_strcspn.c
|
host_strcspn.c
|
||||||
|
@ -2,6 +2,13 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "storage.h"
|
#include "storage.h"
|
||||||
|
|
||||||
|
host_ca *host_ca_new(void)
|
||||||
|
{
|
||||||
|
host_ca *hca = snew(host_ca);
|
||||||
|
memset(hca, 0, sizeof(*hca));
|
||||||
|
return hca;
|
||||||
|
}
|
||||||
|
|
||||||
void host_ca_free(host_ca *hca)
|
void host_ca_free(host_ca *hca)
|
||||||
{
|
{
|
||||||
sfree(hca->name);
|
sfree(hca->name);
|
@ -424,8 +424,7 @@ host_ca *host_ca_load(const char *name)
|
|||||||
if (!rkey)
|
if (!rkey)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
host_ca *hca = snew(host_ca);
|
host_ca *hca = host_ca_new();
|
||||||
memset(hca, 0, sizeof(*hca));
|
|
||||||
hca->name = dupstr(name);
|
hca->name = dupstr(name);
|
||||||
|
|
||||||
if ((s = get_reg_sz(rkey, "PublicKey")) != NULL)
|
if ((s = get_reg_sz(rkey, "PublicKey")) != NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user