accept PGP v3 or v4 fingerprint as alternative to PGP user_id
This commit is contained in:
@@ -104,7 +104,16 @@ static identification_t* get_issuer(private_pgp_cert_t *this)
|
|||||||
static id_match_t has_subject(private_pgp_cert_t *this,
|
static id_match_t has_subject(private_pgp_cert_t *this,
|
||||||
identification_t *subject)
|
identification_t *subject)
|
||||||
{
|
{
|
||||||
return this->user_id->matches(this->user_id, subject);
|
id_match_t match_user_id;
|
||||||
|
|
||||||
|
match_user_id = this->user_id->matches(this->user_id, subject);
|
||||||
|
if (match_user_id == ID_MATCH_NONE &&
|
||||||
|
subject->get_type(subject) == ID_KEY_ID &&
|
||||||
|
chunk_equals(this->fingerprint, subject->get_encoding(subject)))
|
||||||
|
{
|
||||||
|
return ID_MATCH_PERFECT;
|
||||||
|
}
|
||||||
|
return match_user_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -369,7 +378,7 @@ static bool parse_signature(private_pgp_cert_t *this, chunk_t packet)
|
|||||||
/* we parse only V3 signature packets */
|
/* we parse only V3 signature packets */
|
||||||
if (version != 3)
|
if (version != 3)
|
||||||
{
|
{
|
||||||
DBG1(" skipped V%d PGP signature", version);
|
DBG2(" skipped V%d PGP signature", version);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (!pgp_read_scalar(&packet, 1, &len) || len != 5)
|
if (!pgp_read_scalar(&packet, 1, &len) || len != 5)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ conn net-net
|
|||||||
left=PH_IP_MOON
|
left=PH_IP_MOON
|
||||||
leftsubnet=10.1.0.0/16
|
leftsubnet=10.1.0.0/16
|
||||||
leftcert=moonCert.asc
|
leftcert=moonCert.asc
|
||||||
|
leftid=@#71270432cd763a18020ac988c0e75aed
|
||||||
leftfirewall=yes
|
leftfirewall=yes
|
||||||
right=PH_IP_SUN
|
right=PH_IP_SUN
|
||||||
rightsubnet=10.2.0.0/16
|
rightsubnet=10.2.0.0/16
|
||||||
|
|||||||
@@ -18,4 +18,5 @@ conn net-net
|
|||||||
right=PH_IP_MOON
|
right=PH_IP_MOON
|
||||||
rightsubnet=10.1.0.0/16
|
rightsubnet=10.1.0.0/16
|
||||||
rightcert=moonCert.asc
|
rightcert=moonCert.asc
|
||||||
|
rightid=@#71270432cd763a18020ac988c0e75aed
|
||||||
auto=add
|
auto=add
|
||||||
|
|||||||
@@ -18,4 +18,5 @@ conn net-net
|
|||||||
right=PH_IP_SUN
|
right=PH_IP_SUN
|
||||||
rightsubnet=10.2.0.0/16
|
rightsubnet=10.2.0.0/16
|
||||||
rightcert=sunCert.asc
|
rightcert=sunCert.asc
|
||||||
|
rightid=@#b42f31fec80ae3264a101c85977a04ac8d1638d3
|
||||||
auto=add
|
auto=add
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ conn net-net
|
|||||||
left=PH_IP_SUN
|
left=PH_IP_SUN
|
||||||
leftsubnet=10.2.0.0/16
|
leftsubnet=10.2.0.0/16
|
||||||
leftcert=sunCert.asc
|
leftcert=sunCert.asc
|
||||||
|
leftid=@#b42f31fec80ae3264a101c85977a04ac8d1638d3
|
||||||
leftfirewall=yes
|
leftfirewall=yes
|
||||||
right=PH_IP_MOON
|
right=PH_IP_MOON
|
||||||
rightsubnet=10.1.0.0/16
|
rightsubnet=10.1.0.0/16
|
||||||
|
|||||||
Reference in New Issue
Block a user