1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00
putty-source/utils/host_ca_new_free.c
Simon Tatham dc7ba12253 Permit configuring RSA signature types in certificates.
As distinct from the type of signature generated by the SSH server
itself from the host key, this lets you exclude (and by default does
exclude) the old "ssh-rsa" SHA-1 signature type from the signature of
the CA on the certificate.
2022-05-02 11:17:58 +01:00

25 lines
574 B
C

#include "defs.h"
#include "misc.h"
#include "storage.h"
host_ca *host_ca_new(void)
{
host_ca *hca = snew(host_ca);
memset(hca, 0, sizeof(*hca));
hca->opts.permit_rsa_sha1 = false;
hca->opts.permit_rsa_sha256 = true;
hca->opts.permit_rsa_sha512 = true;
return hca;
}
void host_ca_free(host_ca *hca)
{
sfree(hca->name);
if (hca->ca_public_key)
strbuf_free(hca->ca_public_key);
for (size_t i = 0; i < hca->n_hostname_wildcards; i++)
sfree(hca->hostname_wildcards[i]);
sfree(hca->hostname_wildcards);
sfree(hca);
}