results from the single responses is stored in the corresponding certinfo_t structs
[strongswan.git] / src / libstrongswan / crypto / certinfo.c
index baebe3f..8c899e6 100644 (file)
@@ -48,6 +48,11 @@ struct private_certinfo_t {
        cert_status_t status;
 
        /**
+        * Certificate status is for one-time use only
+        */
+       bool once;
+
+       /**
         * Time when the certificate status info was generated
         */
        time_t thisUpdate;
@@ -89,6 +94,14 @@ ENUM(crl_reason_names, REASON_UNSPECIFIED, REASON_REMOVE_FROM_CRL,
 );
 
 /**
+ * Implements certinfo_t.equals_serialNumber
+ */
+static bool equals_serialNumber(const private_certinfo_t *this, const private_certinfo_t *that)
+{
+       return chunk_equals(this->serialNumber, that->serialNumber);
+}
+
+/**
  * Implements certinfo_t.get_serialNumber
  */
 static chunk_t get_serialNumber(const private_certinfo_t *this)
@@ -113,6 +126,22 @@ static cert_status_t get_status(const private_certinfo_t *this)
 }
 
 /**
+ * Implements certinfo_t.set_thisUpdate
+ */
+static void set_thisUpdate(private_certinfo_t *this, time_t thisUpdate)
+{
+       this->thisUpdate = thisUpdate;
+}
+
+/**
+ * Implements certinfo_t.get_thisUpdate
+ */
+static time_t get_thisUpdate(const private_certinfo_t *this)
+{
+       return this->thisUpdate;
+}
+
+/**
  * Implements certinfo_t.set_nextUpdate
  */
 static void set_nextUpdate(private_certinfo_t *this, time_t nextUpdate)
@@ -179,14 +208,18 @@ certinfo_t *certinfo_create(chunk_t serial)
        /* initialize */
        this->serialNumber = chunk_clone(serial);
        this->status = CERT_UNDEFINED;
+       this->thisUpdate = UNDEFINED_TIME;
        this->nextUpdate = UNDEFINED_TIME;
        this->revocationTime = UNDEFINED_TIME;
        this->revocationReason = REASON_UNSPECIFIED;
 
        /* public functions */
+       this->public.equals_serialNumber = (bool (*) (const certinfo_t*,const certinfo_t*))equals_serialNumber;
        this->public.get_serialNumber = (chunk_t (*) (const certinfo_t*))get_serialNumber;
        this->public.set_status = (void (*) (certinfo_t*,cert_status_t))set_status;
        this->public.get_status = (cert_status_t (*) (const certinfo_t*))get_status;
+       this->public.set_thisUpdate = (void (*) (certinfo_t*,time_t))set_thisUpdate;
+       this->public.get_thisUpdate = (time_t (*) (const certinfo_t*))get_thisUpdate;
        this->public.set_nextUpdate = (void (*) (certinfo_t*,time_t))set_nextUpdate;
        this->public.get_nextUpdate = (time_t (*) (const certinfo_t*))get_nextUpdate;
        this->public.set_revocationTime = (void (*) (certinfo_t*,time_t))set_revocationTime;