Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
teep_*
libteep.a
libteep.so
bin/teep_*
bin/cose_parser
obj
*Dockerfile
docker-compose.yml
Expand Down
10 changes: 4 additions & 6 deletions Makefile.cose
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ else
LDFLAGS += -lcrypto
endif

.PHONY: all clean run

.PHONY: all
all: $(TAM0) $(TAM1) $(AGENT) $(VERIFIER) $(TRUST_ANCHOR)

include Makefile.common
Expand Down Expand Up @@ -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)

Expand All @@ -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

1 change: 0 additions & 1 deletion Makefile.parser
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 1 addition & 5 deletions ossl3.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions src/teep_cose.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/teep_message_decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down