mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 01:18:00 +00:00
f579b3c01e
This replaces the previous placeholder scheme of having a list of hostname wildcards with implicit logical-OR semantics (if any wildcard matched then the certificate would be trusted to sign for that host). That scheme didn't allow for exceptions within a domain ('everything in example.com except extra-high-security-machine.example.com'), and also had no way to specify port numbers. In the new system, you can still write a hostname wildcard by itself in the simple case, but now those are just atomic subexpressions in a boolean-logic domain-specific language I've made up. So if you want multiple wildcards, you can separate them with || in a single longer expression, and also you can use && and ! to impose exceptions on top of that. Full details of the expression language are in the comment at the top of utils/cert-expr.c. It'll need documenting properly before release, of course. For the sake of backwards compatibility for early adopters who've already set up configuration in the old system, I've put in some code that will read the old MatchHosts configuration and automatically translate it into the equivalent boolean expression (by simply stringing together the list of wildcards with || between them).
23 lines
473 B
C
23 lines
473 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);
|
|
sfree(hca->validity_expression);
|
|
if (hca->ca_public_key)
|
|
strbuf_free(hca->ca_public_key);
|
|
sfree(hca);
|
|
}
|