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

197 aes gcm siv #265

Merged
merged 16 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
ccc0fa5
[nasa/cryptolib#197] Began support for AES_GCM_SIV
Donnie-Ice Jun 13, 2024
4000890
[nasa/cryptolib#197] Commented out wolfcrypt SIV related calls
Donnie-Ice Jul 15, 2024
f36f5a1
[nasa/cryptolib#197] Update docker file to install gpg-error and libg…
jlucas9 Jul 17, 2024
a29dd8f
[nasa/cryptolib#197] Corrected mode in algorithm switch statement
Donnie-Ice Jul 17, 2024
15c0364
[nasa/cryptolib#197] Added aes_gcm_siv unit test files (utest throwin…
Donnie-Ice Jul 18, 2024
3d29e52
[nasa/cryptolib#197] Added missing call to UTEST_MAIN()
Donnie-Ice Jul 22, 2024
abe2947
[nasa/cryptolib#264] Resolved non-erroring seg faults in unit tests
Donnie-Ice Jul 22, 2024
a8ec6ec
[nasa/cryptolib#197] Added AES-GCM-SIV Encryption Unit Tests
Donnie-Ice Jul 25, 2024
178a30a
[nasa/cryptolib#197] GCM-SIV Decryption unit tests in progress
Donnie-Ice Jul 26, 2024
50617cb
[nasa/cryptolib#197] Added GCM-SIV Decryption Unit tests
Donnie-Ice Jul 26, 2024
32de194
[nasa/cryptolib#197] Added SIV and GCM-SIV Decryption Support through…
Donnie-Ice Jul 26, 2024
e6086bf
[nasa/cryptolib#197] AES_GCM_SIV Code Cleanup
Donnie-Ice Jul 29, 2024
f8306f2
[nasa/cryptolib#197] Updated builds to install Libgcrypt 1.11.0 and l…
Donnie-Ice Jul 29, 2024
48a19cd
[nasa/cryptolib#197] Resolve build issues on RHEL
Donnie-Ice Aug 1, 2024
483eca8
[nasa/cryptolib#197] Source bashrc before running gcov
Donnie-Ice Aug 1, 2024
efcf356
[nasa/cryptolib#197] Removed commented code and references to GCM-SIV…
Donnie-Ice Aug 2, 2024
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
103 changes: 95 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,26 @@ jobs:
- name: Update
run: sudo apt-get update
- name: Install Dependencies
run: sudo apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat libgcrypt20-dev python3
run: sudo apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat python3
- name: Install Python Libraries
run: sudo pip install pycryptodome
- name: Install Libgcrypt
run: >
curl
-LS https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.50.tar.bz2
-o /tmp/libgpg-error-1.50.tar.bz2
&& tar -xjf /tmp/libgpg-error-1.50.tar.bz2 -C /tmp/
&& cd /tmp/libgpg-error-1.50
&& sudo ./configure
&& sudo make install
&& curl
-LS https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.11.0.tar.bz2
-o /tmp/libgcrypt-1.11.0.tar.bz2
&& tar -xjf /tmp/libgcrypt-1.11.0.tar.bz2 -C /tmp/
&& cd /tmp/libgcrypt-1.11.0
&& sudo ./configure
&& sudo make install
&& sudo ldconfig
# End Container Setup

- name: Minimal Build Script
Expand All @@ -38,9 +55,26 @@ jobs:
- name: Update
run: sudo apt-get update
- name: Install Dependencies
run: sudo apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat libgcrypt20-dev python3
run: sudo apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat python3
- name: Install Python Libraries
run: sudo pip install pycryptodome
- name: Install Libgcrypt
run: >
curl
-LS https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.50.tar.bz2
-o /tmp/libgpg-error-1.50.tar.bz2
&& tar -xjf /tmp/libgpg-error-1.50.tar.bz2 -C /tmp/
&& cd /tmp/libgpg-error-1.50
&& sudo ./configure
&& sudo make install
&& curl
-LS https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.11.0.tar.bz2
-o /tmp/libgcrypt-1.11.0.tar.bz2
&& tar -xjf /tmp/libgcrypt-1.11.0.tar.bz2 -C /tmp/
&& cd /tmp/libgcrypt-1.11.0
&& sudo ./configure
&& sudo make install
&& sudo ldconfig
# End Container Setup

- name: Internal Build Script
Expand Down Expand Up @@ -70,9 +104,26 @@ jobs:
- name: Update
run: sudo apt-get update
- name: Install Dependencies
run: sudo apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat libgcrypt20-dev python3
run: sudo apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat python3
- name: Install Python Libraries
run: sudo pip install pycryptodome
- name: Install Libgcrypt
run: >
curl
-LS https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.50.tar.bz2
-o /tmp/libgpg-error-1.50.tar.bz2
&& tar -xjf /tmp/libgpg-error-1.50.tar.bz2 -C /tmp/
&& cd /tmp/libgpg-error-1.50
&& sudo ./configure
&& sudo make install
&& curl
-LS https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.11.0.tar.bz2
-o /tmp/libgcrypt-1.11.0.tar.bz2
&& tar -xjf /tmp/libgcrypt-1.11.0.tar.bz2 -C /tmp/
&& cd /tmp/libgcrypt-1.11.0
&& sudo ./configure
&& sudo make install
&& sudo ldconfig
# End Container Setup

- name: KMC Build Script
Expand Down Expand Up @@ -102,9 +153,26 @@ jobs:
- name: Update
run: sudo apt-get update
- name: Install Dependencies
run: sudo apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat libgcrypt20-dev python3 autoconf libtool
run: sudo apt-get install -y lcov libcurl4-openssl-dev libmariadb-dev libmariadb-dev-compat python3 autoconf libtool
- name: Install Python Libraries
run: sudo pip install pycryptodome
- name: Install Libgcrypt
run: >
curl
-LS https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.50.tar.bz2
-o /tmp/libgpg-error-1.50.tar.bz2
&& tar -xjf /tmp/libgpg-error-1.50.tar.bz2 -C /tmp/
&& cd /tmp/libgpg-error-1.50
&& sudo ./configure
&& sudo make install
&& curl
-LS https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.11.0.tar.bz2
-o /tmp/libgcrypt-1.11.0.tar.bz2
&& tar -xjf /tmp/libgcrypt-1.11.0.tar.bz2 -C /tmp/
&& cd /tmp/libgcrypt-1.11.0
&& sudo ./configure
&& sudo make install
&& sudo ldconfig
- name: Clone WolfSSL
run: git clone --depth 1 --branch v5.6.0-stable https://github.com/wolfSSL/wolfssl.git /tmp/wolfssl

Expand All @@ -114,7 +182,7 @@ jobs:
#run: cd /tmp/wolfssl/;
# sudo chown -R runner /usr/local;
# ./autogen.sh;
# ./configure --enable-aesccm --enable-aessiv --enable-cmac;
# sudo ./configure --enable-aesccm --enable-aessiv --enable-cmac;
# make;
# make install;
#sudo chown -R runner /usr/local;
Expand Down Expand Up @@ -155,21 +223,40 @@ jobs:
- name: Update
run: yum update -y
- name: Install Dependencies
run: yum install -y epel-release python38-devel libcurl-devel libgpg-error-devel libgcrypt-devel git cmake gcc java-11-openjdk-devel openssl wget mariadb-devel mariadb-common mariadb-connector-c mariadb-connector-c-config mariadb-errmsg mariadb-gssapi-server
run: yum install -y epel-release python38-devel libcurl-devel git cmake gcc java-11-openjdk-devel openssl wget bzip2 ldconfig mariadb-devel mariadb-common mariadb-connector-c mariadb-connector-c-config mariadb-errmsg mariadb-gssapi-server
# Might want to trim this down, but these dependencies should work for KMC
- name: install lcov
run: yum install -y --enablerepo=epel lcov
- name: Install Python Dependencies
run: pip3 install pycryptodome
- name: Install Libgcrypt
run: >
curl
-LS https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.50.tar.bz2
-o /tmp/libgpg-error-1.50.tar.bz2
&& tar -xjf /tmp/libgpg-error-1.50.tar.bz2 -C /tmp/
&& cd /tmp/libgpg-error-1.50
&& ./configure
&& make install
&& curl
-LS https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.11.0.tar.bz2
-o /tmp/libgcrypt-1.11.0.tar.bz2
&& tar -xjf /tmp/libgcrypt-1.11.0.tar.bz2 -C /tmp/
&& cd /tmp/libgcrypt-1.11.0
&& ./configure
&& make install
&& echo "export LD_LIBRARY_PATH=/usr/local/lib/:/usr/local/include:$LD_LIBRARY_PATH" >> ~/.bashrc
&& source ~/.bashrc
&& ldconfig
# End Container Setup

- name: RHEL Build Script
working-directory: ${{github.workspace}}
run: bash ${GITHUB_WORKSPACE}/support/scripts/build_rhel.sh
run: source ~/.bashrc && ${GITHUB_WORKSPACE}/support/scripts/build_rhel.sh

- name: Code-Coverage
working-directory: ${{github.workspace}}
run: make gcov
run: source ~/.bashrc && make gcov

- name: Upload
uses: codecov/codecov-action@v4
Expand Down
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ project(crypto C)
set(SA_CUSTOM_PATH_DEFAULT "../../sa/custom")
set(KEY_CUSTOM_PATH_DEFAULT "../../key/custom")
set(MC_CUSTOM_PATH_DEFAULT "../../mc/custom")
set(MC_LOG_PATH_DEFAULT "log.txt")
set(CRYPTO_CUSTOM_PATH_DEFAULT "../../crypto/custom")


Expand Down Expand Up @@ -57,6 +58,7 @@ option(SYSTEM_INSTALL "SystemInstall" OFF)
option(TEST "Test" OFF)
option(TEST_ENC "Tests - Encryption" OFF)
option(SA_FILE "Save Security Association to File" OFF)
option(KEY_VALIDATION "Validate existance of key duplication" OFF)

OPTION(KMC_MDB_RH "KMC-MDB-RedHat-Integration-Testing" OFF) #Disabled by default, enable with: -DKMC_MDB_RH=ON
OPTION(KMC_MDB_DB "KMC-MDB-Debian-Integration-Testing" OFF) #Disabled by default, enable with: -DKMC_MDB_DB=ON
Expand Down Expand Up @@ -110,11 +112,22 @@ if(SA_FILE)
add_definitions(-DSA_FILE)
endif()

if(KEY_VALIDATION)
add_definitions(-DKEY_VALIDATION)
endif()

if(DEBUG)
add_definitions(-DDEBUG -DOCF_DEBUG -DFECF_DEBUG -DSA_DEBUG -DPDU_DEBUG -DCCSDS_DEBUG -DTC_DEBUG -DMAC_DEBUG -DTM_DEBUG -DAOS_DEBUG)
add_compile_options(-ggdb)
endif()

if(DEFINED MC_LOG_CUSTOM_PATH)
message(STATUS "MC_LOG_CUSTOM_PATH set to: ${MC_LOG_CUSTOM_PATH}")
add_compile_definitions(MC_LOG_PATH="${MC_LOG_CUSTOM_PATH}")
else()
add_compile_definitions(MC_LOG_PATH="${MC_LOG_PATH_DEFAULT}")
endif()

IF(KMC_MDB_RH)
ADD_DEFINITIONS(-DKMC_MDB_RH)
ADD_DEFINITIONS(-DKMC_CFFI_EXCLUDE)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
![Build](https://github.com/nasa/CryptoLib/actions/workflows/build.yml/badge.svg)
[![CodeCov](https://codecov.io/gh/nasa/CryptoLib/branch/main/graph/badge.svg?token=KCOMCQO0ZU)](https://codecov.io/gh/nasa/CryptoLib)

![CryptoLib logo Final All orange](https://github.com/user-attachments/assets/fc02870b-e2d2-4577-83c2-78985d5fbdd6)

# CryptoLib

Provide a software-only solution using the CCSDS Space Data Link Security Protocol - Extended Procedures (SDLS-EP) to secure communications between a spacecraft running the core Flight System (cFS) and a ground station.
Expand Down
Loading
Loading