Bv2.1 7.2.3: Check that subtitle <StartTime> exists and is 0.
[libdcp.git] / src / certificate.cc
index 6edf4f4c87b175a6e605c2cb4bd67b0ec707fb48..2e33907d2e2f1dfd694866e480aa322f160aa832 100644 (file)
@@ -354,6 +354,8 @@ convert_time (ASN1_TIME const * time)
                t.tm_year -= 1900;
        }
 
+       t.tm_mon--;
+
        return t;
 }
 
@@ -361,14 +363,22 @@ struct tm
 Certificate::not_before () const
 {
        DCP_ASSERT (_certificate);
+#if OPENSSL_VERSION_NUMBER > 0x10100000L
        return convert_time(X509_get0_notBefore(_certificate));
+#else
+       return convert_time(X509_get_notBefore(_certificate));
+#endif
 }
 
 struct tm
 Certificate::not_after () const
 {
        DCP_ASSERT (_certificate);
+#if OPENSSL_VERSION_NUMBER > 0x10100000L
        return convert_time(X509_get0_notAfter(_certificate));
+#else
+       return convert_time(X509_get_notAfter(_certificate));
+#endif
 }
 
 string