#include <openssl/aes.h>
+#if defined(__OpenBSD__)
+ # define OPENSSL_OLD_API
+#else
+ #if OPENSSL_VERSION_NUMBER < 0x10100000
+ #define OPENSSL_OLD_API
+ #endif
+#endif
+
/* AES requires data lengths that are a multiple of the block size */
#define TPM_AES_BITS 128
/* The AES block size is always 16 bytes */
}
}
if (rc == 0) {
-#if OPENSSL_VERSION_NUMBER < 0x10100000
+#if defined OPENSSL_OLD_API
bnn = rsa->n;
bnp = rsa->p;
bnq = rsa->q;
rc = TPM_bin2bn((TPM_BIGNUM *)&e, earr, ebytes); /* freed by caller */
}
if (rc == 0) {
-#if OPENSSL_VERSION_NUMBER < 0x10100000
+#if defined OPENSSL_OLD_API
(*rsa_pub_key)->n = n;
(*rsa_pub_key)->e = e;
(*rsa_pub_key)->d = NULL;
rc = TPM_bin2bn((TPM_BIGNUM *)&d, darr, dbytes); /* freed by caller */
}
if (rc == 0) {
-#if OPENSSL_VERSION_NUMBER < 0x10100000
+#if defined OPENSSL_OLD_API
(*rsa_pri_key)->n = n;
(*rsa_pri_key)->e = e;
(*rsa_pri_key)->d = d;