aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2020-03-24 08:28:19 -0700
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2020-03-24 09:13:46 -0700
commit442c718051bc8e697b38d99fb91563277c64369e (patch)
tree2e1285e588863143adbfecc12526251e849bc0ba
parent0d58f14cacb195e35aa13ae0d5574e26f106a9b3 (diff)
downloadopenssl_tpm2_engine-442c718051bc8e697b38d99fb91563277c64369e.tar.gz
Fix OpenSSL 1.0.2 build
Older versions of OpenSSL are giving the error tpm2-common.h:82:10: error: 'struct stack_st_TSSOPTPOLICY' declared inside parameter list [-Werror] Fix this by adding a DECLARE_STACK_OF to tpm2-asn.1 and including it Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--tpm2-asn.h2
-rw-r--r--tpm2-common.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/tpm2-asn.h b/tpm2-asn.h
index 93a97fc..b10d032 100644
--- a/tpm2-asn.h
+++ b/tpm2-asn.h
@@ -10,6 +10,7 @@
#define _TPM2_ASN_H
#include <openssl/asn1t.h>
+#include <openssl/pem.h>
/*
* Define the format of policy commands required for TPM enhanced authorization.
@@ -25,6 +26,7 @@ typedef struct {
} TSSOPTPOLICY;
#if OPENSSL_VERSION_NUMBER < 0x10100000
+DECLARE_STACK_OF(TSSOPTPOLICY);
#define sk_TSSOPTPOLICY_new_null() SKM_sk_new_null(TSSOPTPOLICY)
#define sk_TSSOPTPOLICY_push(sk, policy) SKM_sk_push(TSSOPTPOLICY, sk, policy)
#define sk_TSSOPTPOLICY_pop(sk) SKM_sk_pop(TSSOPTPOLICY, sk)
diff --git a/tpm2-common.h b/tpm2-common.h
index 046761c..6e2028f 100644
--- a/tpm2-common.h
+++ b/tpm2-common.h
@@ -1,5 +1,6 @@
#ifndef _TPM2_COMMON_H
#define _TPM2_COMMON_H
+#include "tpm2-asn.h"
#define T2_AES_KEY_BITS 128
#define T2_AES_KEY_BYTES (T2_AES_KEY_BITS/8)