summaryrefslogtreecommitdiffstats
path: root/tpm-util/duplicate/sampleMakefile
diff options
context:
space:
mode:
authorArun kumar Sekar <arunkumarsit@gmail.com>2018-03-30 11:20:30 -0700
committerArun kumar sekar <arunkumarsit@gmail.com>2018-04-03 21:14:48 +0000
commit2ac563372735668ac9687c57e35e39c3e4553ff0 (patch)
tree4f276f8feba53a700f73a4aa9f2f55187444dff5 /tpm-util/duplicate/sampleMakefile
parent3d5e48d877919ec8d33e1d1ee3682fb1f0bc0532 (diff)
Utility to Import external RSA pem key into TPM
Duplicate tool - Takes RSA private key in pem format as input and generates TPM structured buffers as expected by tpm Import Import tool - Takes input buffers from Duplicate tool and results in pub/priv blobs which can be used to load the key in tpm storage heirarchy's as child to primary key Change-Id: I0af6676895ce0cc22c70e5546908e905b78bb71e Issue-ID: AAF-207 Signed-off-by: Arun kumar Sekar <arunkumarsit@gmail.com>
Diffstat (limited to 'tpm-util/duplicate/sampleMakefile')
-rw-r--r--tpm-util/duplicate/sampleMakefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/tpm-util/duplicate/sampleMakefile b/tpm-util/duplicate/sampleMakefile
new file mode 100644
index 0000000..5139954
--- /dev/null
+++ b/tpm-util/duplicate/sampleMakefile
@@ -0,0 +1,42 @@
+
+CC = gcc
+#CC = g++
+LD = ld
+AR = ar
+LDDFLAGS += -fPIC
+ARFLAGS = -rc
+
+TSS_DIR?=/home/pramod/tpm2-tss
+OPENSSL_DIR?=/usr/local/bin/openssl
+
+OUTPUT=ossl_tpm_duplicate
+
+OBJS= util.o \
+ marshal.o \
+ crypto_aux.o \
+ tpm_duplication_aux.o \
+ main.o
+
+
+CFLAGS += -g -fPIC -I./include -I${TSS_DIR}/include/ -I$(TSS_DIR)/sysapi/include #-I${OPENSSL_DIR}/include/
+
+#LDFLAGS += -L${OPENSSL_DIR}/lib -ldl -L/usr/local/lib/ -lsapi -ltcti-device -ltcti-tabrmd
+LDFLAGS += -ldl -L/usr/local/lib/ -lsapi -ltcti-device -ltcti-tabrmd
+
+LIBS = -lpthread -lcrypto -lssl
+
+%.o : %.c
+ $(CC) -c $(CFLAGS) $< -o $@
+
+
+$(OUTPUT): $(OBJS)
+ $(CC) $(OBJS) $(LDFLAGS) ${LIBS} -o $(OUTPUT)
+
+.PHONY: all
+all: $(OUTPUT)
+
+install:
+ @set -e; for i in $(OUTPUT); do mv $$i ../../bin/$$i ; done
+
+clean:
+ rm -f *.o $(OUTPUT) *.so