Skip to content

Commit 6e402ba

Browse files
committed
WIP
1 parent e0872fe commit 6e402ba

18 files changed

Lines changed: 713 additions & 449 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,14 @@ jobs:
218218
python3 tests/infra/platform_detection.py snp milan
219219
shell: bash
220220

221+
# Move to container
222+
- name: "Install dependencies"
223+
shell: bash
224+
run: |
225+
set -ex
226+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --component rustfmt
227+
export PATH="$HOME/.cargo/bin:$PATH"
228+
221229
- name: "Build Debug"
222230
run: |
223231
set -ex
@@ -299,6 +307,14 @@ jobs:
299307
python3 tests/infra/platform_detection.py snp genoa
300308
shell: bash
301309

310+
# Move to container
311+
- name: "Install dependencies"
312+
shell: bash
313+
run: |
314+
set -ex
315+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --component rustfmt
316+
export PATH="$HOME/.cargo/bin:$PATH"
317+
302318
- name: "Build Debug"
303319
run: |
304320
set -ex

CMakeLists.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,10 @@ set(HTTP_PARSER_SOURCES
173173
${CCF_3RD_PARTY_EXPORTED_DIR}/llhttp/llhttp.c
174174
)
175175

176+
include(${CCF_DIR}/cmake/cose_openssl.cmake)
176177
include(${CCF_DIR}/cmake/crypto.cmake)
177178
include(${CCF_DIR}/cmake/quickjs.cmake)
178-
include(${CCF_DIR}/cmake/qcbor.cmake)
179179
include(${CCF_DIR}/cmake/evercbor.cmake)
180-
include(${CCF_DIR}/cmake/t_cose.cmake)
181180

182181
# Launcher library
183182
list(APPEND CCF_LAUNCHER_SOURCES ${CCF_DIR}/src/host/run.cpp
@@ -271,8 +270,6 @@ add_ccf_static_library(
271270
LINK_LIBS http_parser ccfcrypto ccf_kv
272271
)
273272

274-
target_link_libraries(ccf_endpoints PRIVATE t_cose) # For cose_auth only
275-
276273
# CCF task system library
277274
add_ccf_static_library(
278275
ccf_tasks
@@ -633,7 +630,7 @@ if(BUILD_TESTS)
633630
crypto_test ${CMAKE_CURRENT_SOURCE_DIR}/src/crypto/test/crypto.cpp
634631
)
635632
target_include_directories(crypto_test PRIVATE ${CCFCRYPTO_INC})
636-
target_link_libraries(crypto_test PRIVATE ccfcrypto t_cose)
633+
target_link_libraries(crypto_test PRIVATE ccfcrypto)
637634

638635
add_unit_test(
639636
cbor_test ${CMAKE_CURRENT_SOURCE_DIR}/src/crypto/test/cbor.cpp
@@ -738,9 +735,7 @@ if(BUILD_TESTS)
738735
add_unit_test(
739736
cose_test ${CMAKE_CURRENT_SOURCE_DIR}/src/crypto/test/cose.cpp
740737
)
741-
target_link_libraries(
742-
cose_test PRIVATE ${CMAKE_THREAD_LIBS_INIT} ccfcrypto t_cose
743-
)
738+
target_link_libraries(cose_test PRIVATE ${CMAKE_THREAD_LIBS_INIT} ccfcrypto)
744739

745740
add_unit_test(pem_test ${CMAKE_CURRENT_SOURCE_DIR}/src/crypto/test/pem.cpp)
746741
target_link_libraries(pem_test PRIVATE ${CMAKE_THREAD_LIBS_INIT})

cgmanifest.json

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -109,26 +109,6 @@
109109
}
110110
}
111111
},
112-
{
113-
"component": {
114-
"type": "git",
115-
"git": {
116-
"repositoryUrl": "https://github.com/laurencelundblade/QCBOR",
117-
"commitHash": "4ace4620d549f22c1163c5b00d3ae0c0dae1d207",
118-
"tag": "v1.5.3"
119-
}
120-
}
121-
},
122-
{
123-
"component": {
124-
"type": "git",
125-
"git": {
126-
"repositoryUrl": "https://github.com/laurencelundblade/t_cose",
127-
"commitHash": "64fbc64dd5982a7f75834d2b9a2a8c9ba8207776",
128-
"tag": "v1.1.3"
129-
}
130-
}
131-
},
132112
{
133113
"component": {
134114
"type": "git",

cmake/cose_openssl.cmake

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the Apache 2.0 License.
3+
4+
include(FetchContent)
5+
6+
FetchContent_Declare(
7+
Corrosion
8+
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
9+
GIT_TAG a1a1aaa057a5da656c06c3d8505b767a4e941709 # v0.5.2
10+
)
11+
FetchContent_MakeAvailable(Corrosion)
12+
13+
corrosion_import_crate(
14+
MANIFEST_PATH
15+
"${CCF_DIR}/src/cose/cose_rs/Cargo.toml"
16+
PROFILE
17+
"release"
18+
CRATES
19+
"cose-rs"
20+
CRATE_TYPES
21+
"staticlib"
22+
)

cmake/crypto.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ target_compile_options(ccfcrypto PUBLIC ${COMPILE_LIBCXX})
4040
target_link_options(ccfcrypto PUBLIC ${LINK_LIBCXX})
4141

4242
target_link_libraries(ccfcrypto PUBLIC crypto ssl evercbor)
43-
target_link_libraries(ccfcrypto PRIVATE t_cose)
43+
target_link_libraries(ccfcrypto PRIVATE ${CMAKE_BINARY_DIR}/libcose_rs.a)
44+
add_dependencies(ccfcrypto cargo-build_cose_rs)
45+
target_include_directories(
46+
ccfcrypto PUBLIC $<BUILD_INTERFACE:${CCF_DIR}/src/cose>
47+
)
4448
set_property(TARGET ccfcrypto PROPERTY POSITION_INDEPENDENT_CODE ON)
4549

4650
install(

cmake/qcbor.cmake

Lines changed: 0 additions & 26 deletions
This file was deleted.

cmake/t_cose.cmake

Lines changed: 0 additions & 34 deletions
This file was deleted.

scripts/setup-ci.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ tdnf --snapshottime=$SOURCE_DATE_EPOCH -y install strace
5858

5959
# For packaging
6060
tdnf --snapshottime=$SOURCE_DATE_EPOCH -y install rpm-build
61+
62+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --component rustfmt
63+
export PATH="$HOME/.cargo/bin:$PATH"

src/cose/cose_rs/Cargo.lock

Lines changed: 94 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cose/cose_rs/Cargo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[package]
2+
name = "cose-rs"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[lib]
7+
crate-type = ["staticlib"]
8+
9+
[dependencies]
10+
cose-openssl = { git = "https://github.com/maxtropets/cose-openssl.git", branch = "f/fix-trailing-bytes" }
11+
12+
[profile.release]
13+
lto = true

0 commit comments

Comments
 (0)