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

Fix QCBOR version check #279

Merged
merged 1 commit into from
Jan 11, 2024
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
10 changes: 9 additions & 1 deletion inc/t_cose/t_cose_common.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* t_cose_common.h
*
* Copyright 2019-2022, Laurence Lundblade
* Copyright 2019-2024, Laurence Lundblade
*
* SPDX-License-Identifier: BSD-3-Clause
*
Expand Down Expand Up @@ -59,6 +59,14 @@ extern "C" {
*/


/**
* Semantic versioning for t_cose x.y.z. Note that these were not defined
* for some releases of t_cose 1.x so !defined(T_COSE_VERSION_MAJOR)
* indicates t_cose 1.x.
*/
#define T_COSE_VERSION_MAJOR 1
#define T_COSE_VERSION_MINOR 1
#define T_COSE_VERSION_PATCH 2


/**
Expand Down
8 changes: 5 additions & 3 deletions src/t_cose_sign1_sign.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* t_cose_sign1_sign.c
*
* Copyright (c) 2018-2021, Laurence Lundblade. All rights reserved.
* Copyright (c) 2018-2024, Laurence Lundblade. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
Expand All @@ -15,11 +15,13 @@
#include "t_cose_util.h"
#include "t_cose_short_circuit.h"

#ifndef QCBOR_1_1
// The OpenBytes API we use was only added in 1.1.

#if !(defined(QCBOR_1_1) || QCBOR_VERSION_MAJOR >= 2 || (QCBOR_VERSION_MAJOR == 1 && QCBOR_VERSION_MINOR >= 1))
/* The OpenBytes API we use was only added in 1.1. */
#error t_cose requires QCBOR 1.1 or greater
#endif


/**
* \file t_cose_sign1_sign.c
*
Expand Down