Make X509_set_not{Before,After} functions rather than macros.

Some bindings libraries are sensitive to the difference and break with
https://boringssl-review.googlesource.com/c/boringssl/+/42524.

Change-Id: If7c3758fba3f71575c36b663fa5e596391e4b362
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/42604
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/x509/x509_set.c b/crypto/x509/x509_set.c
index 8e85a7e..6fd0d63 100644
--- a/crypto/x509/x509_set.c
+++ b/crypto/x509/x509_set.c
@@ -134,6 +134,11 @@
     return (in != NULL);
 }
 
+int X509_set_notBefore(X509 *x, const ASN1_TIME *tm)
+{
+    return X509_set1_notBefore(x, tm);
+}
+
 const ASN1_TIME *X509_get0_notBefore(const X509 *x)
 {
     return x->cert_info->validity->notBefore;
@@ -172,6 +177,11 @@
     return (in != NULL);
 }
 
+int X509_set_notAfter(X509 *x, const ASN1_TIME *tm)
+{
+    return X509_set1_notAfter(x, tm);
+}
+
 const ASN1_TIME *X509_get0_notAfter(const X509 *x)
 {
     return x->cert_info->validity->notAfter;
diff --git a/include/openssl/x509.h b/include/openssl/x509.h
index 6919c90..20c5922 100644
--- a/include/openssl/x509.h
+++ b/include/openssl/x509.h
@@ -512,9 +512,13 @@
 // |X509_getm_notAfter| instead.
 OPENSSL_EXPORT ASN1_TIME *X509_get_notAfter(const X509 *x509);
 
-// The following symbols are deprecated aliases to |X509_set1_*|.
-#define X509_set_notBefore X509_set1_notBefore
-#define X509_set_notAfter X509_set1_notAfter
+// X509_set_notBefore calls |X509_set1_notBefore|. Use |X509_set1_notBefore|
+// instead.
+OPENSSL_EXPORT int X509_set_notBefore(X509 *x509, const ASN1_TIME *tm);
+
+// X509_set_notAfter calls |X509_set1_notAfter|. Use |X509_set1_notAfter|
+// instead.
+OPENSSL_EXPORT int X509_set_notAfter(X509 *x509, const ASN1_TIME *tm);
 
 // X509_get0_uids sets |*out_issuer_uid| and |*out_subject_uid| to non-owning
 // pointers to the issuerUID and subjectUID fields, respectively, of |x509|.