Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tpm: mqtt and curl example uses #315

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tpm/mqtt/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CC=gcc
WOLF_INSTALL_DIR=/usr/local
CFLAGS=-I$(WOLF_INSTALL_DIR)/include -Wall -DCERT_PATH=\"tmp_certs_and_keys/\"
LIBS=-L$(WOLF_INSTALL_DIR)/lib -lwolfssl -lwolftpm -lwolfmqtt

mqtt_tpm_simple: mqtt_tpm_simple.c
gcc $^ -g -o $@ $(CFLAGS) $(LIBS)
14 changes: 14 additions & 0 deletions tpm/mqtt/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## network callback

## TPM certificate


## crypto callback

## check if key is valid


### mosquitto TLS example
`mosquitto -c mosquitto.conf`
`mosquitto_sub -d -p 18883 -t blah --cafile certs/ca-cert.pem -h 127.0.0.1`
`mosquitto_pub -d -p 18883 -t blah --cafile certs/ca-cert.pem -h 127.0.0.1 -m hola`
35 changes: 35 additions & 0 deletions tpm/mqtt/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/bash

set -e

REPO_DIR=../../..
INST_DIR=$(dirname $(realpath $0))/inst

if [ "$1" != "" ]; then
REPO_DIR=$1
fi

if [ "$2" != "" ]; then
INST_DIR=$2
fi

echo "Building wolfSSL with prefix $INST_DIR"
pushd ${REPO_DIR}/wolfssl
./autogen.sh
./configure --prefix=$INST_DIR --enable-wolftpm --enable-debug
make install
popd

echo "Building wolfTPM with prefix $INST_DIR"
pushd ${REPO_DIR}/wolftpm
./autogen.sh
./configure --prefix=$INST_DIR --enable-swtpm --enable-debug
make install
popd

echo "Building wolfMQTT with prefix $INST_DIR"
pushd ${REPO_DIR}/wolfmqtt
./autogen.sh
./configure --prefix=$INST_DIR --enable-debug
make install
popd
Loading