Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'utils/host_ca_new_free.c')
-rw-r--r--utils/host_ca_new_free.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/utils/host_ca_new_free.c b/utils/host_ca_new_free.c
new file mode 100644
index 00000000..4c91c320
--- /dev/null
+++ b/utils/host_ca_new_free.c
@@ -0,0 +1,22 @@
+#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);
+ sfree(hca->validity_expression);
+ if (hca->ca_public_key)
+ strbuf_free(hca->ca_public_key);
+ sfree(hca);
+}