Removed is_newer() from certificate_t, obsoleting all implementations
This commit is contained in:
@@ -296,35 +296,6 @@ METHOD(certificate_t, get_validity, bool,
|
||||
return t <= this->nextUpdate;
|
||||
}
|
||||
|
||||
METHOD(certificate_t, is_newer, bool,
|
||||
private_openssl_crl_t *this, certificate_t *other)
|
||||
{
|
||||
time_t this_update, that_update;
|
||||
chunk_t other_serial;
|
||||
x509_t *x509;
|
||||
bool new;
|
||||
|
||||
x509 = (x509_t*)other;
|
||||
other_serial = x509->get_serial(x509);
|
||||
if (this->serial.ptr != NULL && other_serial.ptr != NULL)
|
||||
{ /* compare crlNumbers if available */
|
||||
new = chunk_compare(this->serial, other_serial) > 0;
|
||||
DBG1(DBG_LIB, " crl #%#B is %s - existing crl #%#B %s",
|
||||
&this->serial, new ? "newer":"not newer",
|
||||
&other_serial, new ? "replaced":"retained");
|
||||
}
|
||||
else
|
||||
{ /* otherwise use thisUpdate */
|
||||
get_validity(this, NULL, &this_update, NULL);
|
||||
other->get_validity(other, NULL, &that_update, NULL);
|
||||
new = this_update > that_update;
|
||||
DBG1(DBG_LIB, " crl from %T is %s - existing crl from %T %s",
|
||||
&this_update, FALSE, new ? "newer":"not newer",
|
||||
&that_update, FALSE, new ? "replaced":"retained");
|
||||
}
|
||||
return new;
|
||||
}
|
||||
|
||||
METHOD(certificate_t, get_encoding, chunk_t,
|
||||
private_openssl_crl_t *this)
|
||||
{
|
||||
@@ -395,7 +366,6 @@ static private_openssl_crl_t *create_empty()
|
||||
.issued_by = _issued_by,
|
||||
.get_public_key = _get_public_key,
|
||||
.get_validity = _get_validity,
|
||||
.is_newer = _is_newer,
|
||||
.get_encoding = _get_encoding,
|
||||
.equals = _equals,
|
||||
.get_ref = _get_ref,
|
||||
|
||||
@@ -383,21 +383,6 @@ METHOD(certificate_t, get_validity, bool,
|
||||
return (t >= this->notBefore && t <= this->notAfter);
|
||||
}
|
||||
|
||||
METHOD(certificate_t, is_newer, bool,
|
||||
private_openssl_x509_t *this, certificate_t *other)
|
||||
{
|
||||
time_t this_update, that_update, now = time(NULL);
|
||||
bool new;
|
||||
|
||||
get_validity(this, &now, &this_update, NULL);
|
||||
other->get_validity(other, &now, &that_update, NULL);
|
||||
new = this_update > that_update;
|
||||
DBG1(DBG_LIB, " certificate from %T is %s - existing certificate "
|
||||
"from %T %s", &this_update, FALSE, new ? "newer":"not newer",
|
||||
&that_update, FALSE, new ? "replaced":"retained");
|
||||
return new;
|
||||
}
|
||||
|
||||
METHOD(certificate_t, get_encoding, chunk_t,
|
||||
private_openssl_x509_t *this)
|
||||
{
|
||||
@@ -481,7 +466,6 @@ static private_openssl_x509_t *create_empty()
|
||||
.issued_by = _issued_by,
|
||||
.get_public_key = _get_public_key,
|
||||
.get_validity = _get_validity,
|
||||
.is_newer = _is_newer,
|
||||
.get_encoding = _get_encoding,
|
||||
.equals = _equals,
|
||||
.get_ref = _get_ref,
|
||||
|
||||
Reference in New Issue
Block a user