diff --git a/.dockerignore b/.dockerignore index 632199f..3e2f080 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,6 +2,8 @@ teep_* libteep.a libteep.so +bin/teep_* +bin/cose_parser obj *Dockerfile docker-compose.yml diff --git a/Makefile.cose b/Makefile.cose index 0de629b..f3686d6 100644 --- a/Makefile.cose +++ b/Makefile.cose @@ -36,8 +36,7 @@ else LDFLAGS += -lcrypto endif -.PHONY: all clean run - +.PHONY: all all: $(TAM0) $(TAM1) $(AGENT) $(VERIFIER) $(TRUST_ANCHOR) include Makefile.common @@ -75,6 +74,7 @@ $(VERIFIER): $(OBJS) $(VERIFIER_OBJ) $(TRUST_ANCHOR): $(OBJS) $(TRUST_ANCHOR_OBJ) $(CC) -o $@ $^ $(LDFLAGS) +.PHONY: clean clean: $(RM) $(OBJS) $(TAM0_OBJ) $(TAM1_OBJ) $(AGENT_OBJ) $(VERIFIER_OBJ) $(TAM0) $(TAM1) $(AGENT) $(VERIFIER) @@ -91,12 +91,10 @@ SOURCES := \ $(SOURCES): $(MAKE) -C testfiles $@ -run: $(TAM0) $(TAM1) $(AGENT) $(VERIFIER) $(SOURCES) - $(TAM0) ./testfiles/query_request.cbor ./testfiles/query_request_cose.cbor || exit 1 +run: $(TAM1) $(AGENT) $(SOURCES) + $(TAM1) ./testfiles/query_request.cbor ./testfiles/query_request_cose.cbor || exit 1 $(AGENT) ./testfiles/query_response.cbor ./testfiles/query_response_cose.cbor || exit 1 $(TAM1) ./testfiles/update.cbor ./testfiles/update_cose.cbor || exit 1 $(AGENT) ./testfiles/teep_success.cbor ./testfiles/teep_success_cose.cbor || exit 1 $(AGENT) ./testfiles/teep_error.cbor ./testfiles/teep_error_cose.cbor || exit 1 - $(AGENT) ./testfiles/evidence.cbor ./testfiles/evidence_cose.cbor || exit 1 - $(VERIFIER) ./testfiles/attestation_results.cbor ./testfiles/attestation_results_cose.cbor || exit 1 diff --git a/Makefile.parser b/Makefile.parser index 10da887..66fcdef 100644 --- a/Makefile.parser +++ b/Makefile.parser @@ -72,7 +72,6 @@ run: $(TAM) $(AGENT) $(VERIFIER) $(AGENT) ./testfiles/update$(COSE_FLAG).cbor || exit 1 $(TAM) ./testfiles/teep_success$(COSE_FLAG).cbor || exit 1 $(TAM) ./testfiles/teep_error$(COSE_FLAG).cbor || exit 1 - $(VERIFIER) ./testfiles/attestation_results$(COSE_FLAG).cbor || exit 1 clean: $(RM) $(OBJS) $(TAM_OBJ) $(AGENT_OBJ) $(VERIFIER_OBJ) $(TAM) $(AGENT) $(VERIFIER) diff --git a/ossl3.Dockerfile b/ossl3.Dockerfile index 3f2261c..8d9bda4 100644 --- a/ossl3.Dockerfile +++ b/ossl3.Dockerfile @@ -5,13 +5,9 @@ FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -RUN apt-get -y install curl git gcc make libcunit1-dev ruby +RUN apt-get -y install curl git gcc make libssl-dev libcunit1-dev ruby RUN gem install cbor-diag -RUN git clone --depth 1 https://github.com/openssl/openssl.git /root/openssl -WORKDIR /root/openssl -RUN ./Configure && make -j`nproc` && make install - RUN git clone --depth 1 https://github.com/laurencelundblade/QCBOR.git /root/QCBOR WORKDIR /root/QCBOR RUN make libqcbor.a install diff --git a/src/teep_cose.c b/src/teep_cose.c index 0120c13..bdf702e 100644 --- a/src/teep_cose.c +++ b/src/teep_cose.c @@ -144,11 +144,12 @@ teep_err_t teep_verify_cose_sign(const UsefulBufC signed_cose, } } - cose_result = t_cose_sign_verify(&verify_ctx, - signed_cose, - NULLUsefulBufC, - returned_payload, - NULL); + cose_result = t_cose_sign_verify_msg(&verify_ctx, + signed_cose, + NULLUsefulBufC, + returned_payload, + NULL, + NULL); if (cose_result != T_COSE_SUCCESS) { result = TEEP_ERR_VERIFICATION_FAILED; } diff --git a/src/teep_message_decode.c b/src/teep_message_decode.c index 592d64a..14e7c5d 100644 --- a/src/teep_message_decode.c +++ b/src/teep_message_decode.c @@ -928,7 +928,7 @@ teep_err_t teep_set_error(QCBORDecodeContext *message, { teep_err_t result = TEEP_SUCCESS; memset(teep_error, 0, sizeof(teep_error_t)); - teep_error->type = TEEP_TYPE_QUERY_REQUEST; + teep_error->type = TEEP_TYPE_TEEP_ERROR; teep_error->contains = TEEP_MESSAGE_CONTAINS_TYPE; result = teep_qcbor_get_next(message, item, QCBOR_TYPE_MAP);