diff mbox series

[04/16] sslapi: Add X509 related wolfSSL definitions

Message ID 20200916135825.40367-5-bage@linutronix.de
State Accepted
Headers show
Series wolfssl SSL impl, PKCS#11 AES, AES key len | expand

Commit Message

Bastian Germann Sept. 16, 2020, 1:58 p.m. UTC
From: Bastian Germann <bage@linutronix.de>

Some X509 definitions are not in the OpenSSL compatibility layer,
so add their native names.

Signed-off-by: Bastian Germann <bage@linutronix.de>
Reviewed-by: Torben Hohn <torben.hohn@linutronix.de>
---
 include/sslapi.h | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/include/sslapi.h b/include/sslapi.h
index 14e4397..74bd424 100644
--- a/include/sslapi.h
+++ b/include/sslapi.h
@@ -57,8 +57,13 @@  static inline uint32_t SSL_X509_get_extended_key_usage(X509 *x)
 #endif
 #endif /* CONFIG_SIGALG_CMS */
 
+#ifdef CONFIG_SSL_IMPL_WOLFSSL
+#define X509_PURPOSE_CODE_SIGN EXTKEYUSE_CODESIGN
+#define SSL_PURPOSE_EMAIL_PROT EXTKEYUSE_EMAILPROT
+#else
 #define X509_PURPOSE_CODE_SIGN (X509_PURPOSE_MAX + 1)
 #define SSL_PURPOSE_EMAIL_PROT X509_PURPOSE_SMIME_SIGN
+#endif
 #define SSL_PURPOSE_CODE_SIGN  X509_PURPOSE_CODE_SIGN
 #define SSL_PURPOSE_DEFAULT SSL_PURPOSE_EMAIL_PROT