summaryrefslogtreecommitdiff
path: root/sysutils/tlsdate/files/patch-src_openssl__compat.h
blob: 3a38722c81aba84dfbe3161dac127127e8470a18 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Obtained from:	https://chromium-review.googlesource.com/c/chromiumos/third_party/tlsdate/+/549533

--- src/openssl_compat.h.orig	2018-10-16 13:25:06 UTC
+++ src/openssl_compat.h
@@ -0,0 +1,31 @@
+/*
+ * openssl_compat.h - OpenSSL 1.1 Compatability Layer
+ * Copyright 2017 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#ifndef SRC_OPENSSL_COMPAT_H_
+#define SRC_OPENSSL_COMPAT_H_
+
+#include <openssl/bio.h>
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+
+static inline void BIO_set_data(BIO *a, void *ptr)
+{
+  a->ptr = ptr;
+}
+
+static inline void *BIO_get_data(BIO *a)
+{
+  return a ? a->ptr : NULL;
+}
+
+static inline void BIO_set_init(BIO *a, int init)
+{
+  a->init = init;
+}
+
+#endif
+
+#endif /* SRC_OPENSSL_COMPAT_H_ */