summaryrefslogtreecommitdiff
path: root/src/crypto/x509v3/v3_ocsp.c
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-01-23 02:15:22 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-01-23 02:15:22 +0000
commite3db1de3381cde942a1b5015588ae9f187f95d89 (patch)
tree169bc1cc8645a140bc03a9f2736e4fce6fd5c011 /src/crypto/x509v3/v3_ocsp.c
parent4fe1c12da4f12ba7ded9eeaf948a3e105ea913b4 (diff)
parent95bf9daba6cf0149365bbafa309153c395c75576 (diff)
downloadboringssl-e3db1de3381cde942a1b5015588ae9f187f95d89.tar.gz
Snap for 11342487 from 95bf9daba6cf0149365bbafa309153c395c75576 to emu-34-releaseemu-34-release
Change-Id: I82dca5a45849a37dc7beb84b3316edaa07fc4878
Diffstat (limited to 'src/crypto/x509v3/v3_ocsp.c')
-rw-r--r--src/crypto/x509v3/v3_ocsp.c81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/crypto/x509v3/v3_ocsp.c b/src/crypto/x509v3/v3_ocsp.c
new file mode 100644
index 00000000..f0ed0b82
--- /dev/null
+++ b/src/crypto/x509v3/v3_ocsp.c
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include <openssl/x509v3.h>
+
+#include <openssl/asn1.h>
+#include <openssl/bio.h>
+#include <openssl/nid.h>
+
+// OCSP extensions and a couple of CRL entry extensions
+
+static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *nonce,
+ BIO *out, int indent);
+
+static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method, void *nocheck,
+ BIO *out, int indent);
+static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method,
+ const X509V3_CTX *ctx, const char *str);
+
+const X509V3_EXT_METHOD v3_crl_invdate = {
+ NID_invalidity_date,
+ 0,
+ ASN1_ITEM_ref(ASN1_GENERALIZEDTIME),
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ i2r_ocsp_acutoff,
+ 0,
+ NULL,
+};
+
+const X509V3_EXT_METHOD v3_ocsp_nocheck = {
+ NID_id_pkix_OCSP_noCheck,
+ 0,
+ ASN1_ITEM_ref(ASN1_NULL),
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ s2i_ocsp_nocheck,
+ 0,
+ 0,
+ i2r_ocsp_nocheck,
+ 0,
+ NULL,
+};
+
+static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *cutoff,
+ BIO *bp, int ind) {
+ if (BIO_printf(bp, "%*s", ind, "") <= 0) {
+ return 0;
+ }
+ if (!ASN1_GENERALIZEDTIME_print(bp, cutoff)) {
+ return 0;
+ }
+ return 1;
+}
+
+// Nocheck is just a single NULL. Don't print anything and always set it
+
+static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method, void *nocheck,
+ BIO *out, int indent) {
+ return 1;
+}
+
+static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method,
+ const X509V3_CTX *ctx, const char *str) {
+ return ASN1_NULL_new();
+}