host_ca_new_free.c 473 B

1234567891011121314151617181920212223
  1. #include "defs.h"
  2. #include "misc.h"
  3. #include "storage.h"
  4. host_ca *host_ca_new(void)
  5. {
  6. host_ca *hca = snew(host_ca);
  7. memset(hca, 0, sizeof(*hca));
  8. hca->opts.permit_rsa_sha1 = false;
  9. hca->opts.permit_rsa_sha256 = true;
  10. hca->opts.permit_rsa_sha512 = true;
  11. return hca;
  12. }
  13. void host_ca_free(host_ca *hca)
  14. {
  15. sfree(hca->name);
  16. sfree(hca->validity_expression);
  17. if (hca->ca_public_key)
  18. strbuf_free(hca->ca_public_key);
  19. sfree(hca);
  20. }