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
8 changes: 2 additions & 6 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ jobs:
name: ${{github.job}}-${{matrix.os}}-${{matrix.compiler}}-coverage
path: build/default/coverage*
- name: Report coverage
run: |
SRC_COV_PERC=$(xmlstarlet sel -t -v 'floor(/coverage/packages/package[@name="src"]/@line-rate * 100)' -n build/default/coverage-xml.xml)
echo "Source coverage: ${SRC_COV_PERC}%" >> $GITHUB_STEP_SUMMARY
run: ./build.sh coverage-summary >> $GITHUB_STEP_SUMMARY

mock-bpa-test:
strategy:
Expand Down Expand Up @@ -178,6 +176,4 @@ jobs:
name: ${{github.job}}-${{matrix.os}}-gcc-coverage
path: build/default/coverage*
- name: Report coverage
run: |
SRC_COV_PERC=$(xmlstarlet sel -t -v 'floor(/coverage/packages/package[@name="src"]/@line-rate * 100)' -n build/default/coverage-xml.xml)
echo "Source coverage: ${SRC_COV_PERC}%" >> $GITHUB_STEP_SUMMARY
run: ./build.sh coverage-summary >> $GITHUB_STEP_SUMMARY
11 changes: 11 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ function cmd_coverage {
cmake --build ${BUILDDIR} -j1 --target \
coverage-html coverage-xml
}
function cmd_coverage_summary {
for DIRNAME in backend crypto policy_provider security_context mock_bpa
do
COV_XPATH="format-number(/coverage/packages/package[@name='src.${DIRNAME}']/@line-rate * 100, '#.0')"
COV_PERC=$(xmlstarlet sel -t -v "${COV_XPATH}" -n build/default/coverage-xml.xml 2>/dev/null)
echo "Source ${DIRNAME} coverage: ${COV_PERC}%"
done
}

function cmd_deps {
./resources/deps.sh
Expand Down Expand Up @@ -194,6 +202,9 @@ case "$1" in
coverage)
cmd_coverage
;;
coverage-summary)
cmd_coverage_summary
;;
deps)
cmd_deps
;;
Expand Down
2 changes: 1 addition & 1 deletion docs/api/10-bsl-developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ DICT_DEF2(BSL_SecCtxDict, uint64_t, M_BASIC_OPLIST, BSL_SecCtxDesc_t, M_POD_OPLI

## Citations and References

For definitions from rfc's and other sources, `@cite [source]` in the Doxygen header.
For definitions from IETF RFCs and other sources, `@cite [source]` in the Doxygen header.
If possible (e.g. for RFCs) include the document number in the text for convenience, as in ```RFC XXXX @cite rfcXXXX```.

# File Naming
Expand Down
16 changes: 16 additions & 0 deletions docs/api/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ backends
Backends
BCB
BCBs
Berners
BIB's
Birkholz
Birrane
Bitwise
Bormann
bpa
BPA's
BPSec
Expand All @@ -33,6 +36,7 @@ BPv
BSL
BSLs
BSLX
bstr
BTSD
BundleCtx
Burleigh
Expand All @@ -42,10 +46,12 @@ bytestream
bytestring
bytestrings
callee's
Carsten
CBOR
cek
centric
CFE
Christoph
ciphertext
CLA
clin
Expand Down Expand Up @@ -90,6 +96,7 @@ frontend
Frontend
GCM
Heiner
Henk
hmac
html
IANA
Expand All @@ -102,6 +109,7 @@ ipn
IPN
IPPT
IsInt
isspace
JHU
Josefsson
JPL
Expand All @@ -113,6 +121,7 @@ lifecycle
Lifecycles
malloc
MALLOC
Masinter
McKeever
md
mem
Expand Down Expand Up @@ -173,17 +182,24 @@ SWaP
syslog
Todo
TODO
tstr
typedef
UDPCL
uint
un
Uncategorized
underlayer
Unescape
unicode
unix
uri
URI
url
validator
verifier
Verifier
VERIFIER
Vigano
VxWorks
whitespace
Whitespace
Expand Down
56 changes: 56 additions & 0 deletions docs/api/refs.bib
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,34 @@ @misc{iana:bundle
title = {{Bundle Protocol registry}},
url = {https://www.iana.org/assignments/bundle/bundle.xhtml},
}
@misc{rfc3339,
series = {Request for Comments},
number = 3339,
howpublished = {RFC 3339},
publisher = {RFC Editor},
doi = {10.17487/RFC3339},
url = {https://www.rfc-editor.org/info/rfc3339},
author = {Chris Newman and Graham Klyne},
title = {{Date and Time on the Internet: Timestamps}},
pagetotal = 18,
year = 2002,
month = jul,
abstract = {This document defines a date and time format for use in Internet protocols that is a profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.},
}
@misc{rfc3986,
series = {Request for Comments},
number = 3986,
howpublished = {RFC 3986},
publisher = {RFC Editor},
doi = {10.17487/RFC3986},
url = {https://www.rfc-editor.org/info/rfc3986},
author = {Tim Berners-Lee and Roy T. Fielding and Larry M Masinter},
title = {{Uniform Resource Identifier (URI): Generic Syntax}},
pagetotal = 61,
year = 2005,
month = jan,
abstract = {A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource. This specification defines the generic URI syntax and a process for resolving URI references that might be in relative form, along with guidelines and security considerations for the use of URIs on the Internet. The URI syntax defines a grammar that is a superset of all valid URIs, allowing an implementation to parse the common components of a URI reference without knowing the scheme-specific requirements of every possible identifier. This specification does not define a generative grammar for URIs; that task is performed by the individual specifications of each URI scheme. {[}STANDARDS-TRACK{]}},
}
@misc{rfc4648,
series = {Request for Comments},
number = 4648,
Expand Down Expand Up @@ -50,6 +78,34 @@ @misc{rfc7517
month = may,
abstract = {A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key. This specification also defines a JWK Set JSON data structure that represents a set of JWKs. Cryptographic algorithms and identifiers for use with this specification are described in the separate JSON Web Algorithms (JWA) specification and IANA registries established by that specification.},
}
@misc{rfc8259,
series = {Request for Comments},
number = 8259,
howpublished = {RFC 8259},
publisher = {RFC Editor},
doi = {10.17487/RFC8259},
url = {https://www.rfc-editor.org/info/rfc8259},
author = {Tim Bray},
title = {{The JavaScript Object Notation (JSON) Data Interchange Format}},
pagetotal = 16,
year = 2017,
month = dec,
abstract = {JavaScript Object Notation (JSON) is a lightweight, text-based, language-independent data interchange format. It was derived from the ECMAScript Programming Language Standard. JSON defines a small set of formatting rules for the portable representation of structured data. This document removes inconsistencies with other specifications of JSON, repairs specification errors, and offers experience-based interoperability guidance.},
}
@misc{rfc8610,
series = {Request for Comments},
number = 8610,
howpublished = {RFC 8610},
publisher = {RFC Editor},
doi = {10.17487/RFC8610},
url = {https://www.rfc-editor.org/info/rfc8610},
author = {Henk Birkholz and Christoph Vigano and Carsten Bormann},
title = {{Concise Data Definition Language (CDDL): A Notational Convention to Express Concise Binary Object Representation (CBOR) and JSON Data Structures}},
pagetotal = 64,
year = 2019,
month = jun,
abstract = {This document proposes a notational convention to express Concise Binary Object Representation (CBOR) data structures (RFC 7049). Its main goal is to provide an easy and unambiguous way to express structures for protocol messages and data formats that use CBOR or JSON.},
}
@misc{rfc9171,
series = {Request for Comments},
number = 9171,
Expand Down
1 change: 1 addition & 0 deletions docs/api/spellcheck.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<xsl:template match="verbatim"/>
<xsl:template match="programlisting"/>
<xsl:template match="dot"/>
<xsl:template match="ulink"/>
<!-- remove characters that aspell cannot handle -->
<xsl:template match="para/text()">
<xsl:value-of select="translate(., '&#8217;', '')"/>
Expand Down
4 changes: 1 addition & 3 deletions src/backend/SecParam.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* @details
*
* The details from the RFC are as follows:
* The details from the RFC Section 3.6 @cite rfc9172 are as follows:
*
* <blockquote>
* This field captures one or more security context parameters that should be used
Expand All @@ -47,8 +47,6 @@
*
* </blockquote>
*
* @cite https://www.rfc-editor.org/rfc/rfc9172.html#section-3.6-3.10.1
*
* @author Bill.Van.Besien@jhuapl.edu
*/
/** @file
Expand Down
53 changes: 25 additions & 28 deletions src/mock_bpa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,32 @@ target_compile_options(bsl_mock_bpa PRIVATE -Wshadow -Wpointer-arith -Wstrict-pr

target_sources(
bsl_mock_bpa PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/bsl_mock_bpa.h
${CMAKE_CURRENT_SOURCE_DIR}/bsl_mock_bpa_crc.h
${CMAKE_CURRENT_SOURCE_DIR}/bsl_mock_bpa_eid.h
${CMAKE_CURRENT_SOURCE_DIR}/bsl_mock_bpa_eidpat.h
${CMAKE_CURRENT_SOURCE_DIR}/bsl_mock_bpa_encode.h
${CMAKE_CURRENT_SOURCE_DIR}/bsl_mock_bpa_decode.h
${CMAKE_CURRENT_SOURCE_DIR}/bsl_mock_bpa_policy_config.h
${CMAKE_CURRENT_SOURCE_DIR}/mock_bpa_policy_params.h
${CMAKE_CURRENT_SOURCE_DIR}/mock_bpa_policy_registry.h
${CMAKE_CURRENT_SOURCE_DIR}/mock_bpa_ctr.h
${CMAKE_CURRENT_SOURCE_DIR}/BPSecLib_MockBPA.h
${CMAKE_CURRENT_SOURCE_DIR}/agent.h
${CMAKE_CURRENT_SOURCE_DIR}/crc.h
${CMAKE_CURRENT_SOURCE_DIR}/eid.h
${CMAKE_CURRENT_SOURCE_DIR}/eidpat.h
${CMAKE_CURRENT_SOURCE_DIR}/encode.h
${CMAKE_CURRENT_SOURCE_DIR}/decode.h
${CMAKE_CURRENT_SOURCE_DIR}/text_util.h
${CMAKE_CURRENT_SOURCE_DIR}/policy_config.h
${CMAKE_CURRENT_SOURCE_DIR}/policy_params.h
${CMAKE_CURRENT_SOURCE_DIR}/policy_registry.h
${CMAKE_CURRENT_SOURCE_DIR}/ctr.h
${CMAKE_CURRENT_SOURCE_DIR}/MockBPA.h
)
target_sources(
bsl_mock_bpa PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/bsl_mock_bpa.c
${CMAKE_CURRENT_SOURCE_DIR}/bsl_mock_bpa_crc.c
${CMAKE_CURRENT_SOURCE_DIR}/bsl_mock_bpa_eid.c
${CMAKE_CURRENT_SOURCE_DIR}/bsl_mock_bpa_eidpat.c
${CMAKE_CURRENT_SOURCE_DIR}/bsl_mock_bpa_encode.c
${CMAKE_CURRENT_SOURCE_DIR}/bsl_mock_bpa_decode.c
${CMAKE_CURRENT_SOURCE_DIR}/bsl_mock_bpa_policy_config.c
${CMAKE_CURRENT_SOURCE_DIR}/mock_bpa_policy_params.c
${CMAKE_CURRENT_SOURCE_DIR}/mock_bpa_policy_registry.c
${CMAKE_CURRENT_SOURCE_DIR}/mock_bpa_ctr.c
)
target_include_directories(
bsl_mock_bpa PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/bsl>
${CMAKE_CURRENT_SOURCE_DIR}/agent.c
${CMAKE_CURRENT_SOURCE_DIR}/crc.c
${CMAKE_CURRENT_SOURCE_DIR}/eid.c
${CMAKE_CURRENT_SOURCE_DIR}/eidpat.c
${CMAKE_CURRENT_SOURCE_DIR}/encode.c
${CMAKE_CURRENT_SOURCE_DIR}/decode.c
${CMAKE_CURRENT_SOURCE_DIR}/text_util.c
${CMAKE_CURRENT_SOURCE_DIR}/policy_config.c
${CMAKE_CURRENT_SOURCE_DIR}/policy_params.c
${CMAKE_CURRENT_SOURCE_DIR}/policy_registry.c
${CMAKE_CURRENT_SOURCE_DIR}/ctr.c
)
set_target_properties(bsl_mock_bpa
PROPERTIES
Expand All @@ -63,11 +60,11 @@ set_target_properties(bsl_mock_bpa
target_link_libraries(bsl_mock_bpa PUBLIC MLIB::mlib)
target_link_libraries(bsl_mock_bpa PUBLIC QCBOR::qcbor)
target_link_libraries(bsl_mock_bpa PUBLIC Jansson::Jansson)
target_link_libraries(bsl_mock_bpa PUBLIC bsl_front bsl_default_sc bsl_sample_pp)
target_link_libraries(bsl_mock_bpa PUBLIC bsl_front bsl_dynamic bsl_default_sc bsl_sample_pp)

add_executable(bsl-mock-bpa)
target_sources(bsl-mock-bpa PRIVATE mock_bpa.c)
target_link_libraries(bsl-mock-bpa PUBLIC bsl_mock_bpa bsl_dynamic bsl_default_sc bsl_sample_pp bsl_crypto)
target_link_libraries(bsl-mock-bpa PUBLIC bsl_mock_bpa bsl_crypto)
target_link_libraries(bsl-mock-bpa PUBLIC Threads::Threads)

# Installation config
Expand Down
16 changes: 8 additions & 8 deletions src/mock_bpa/BPSecLib_MockBPA.h → src/mock_bpa/MockBPA.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
* the prime contract 80NM0018D0004 between the Caltech and NASA under
* subcontract 1700763.
*/
#ifndef _BSL_MockBPA_BPSECLIB_MockBPA_H_
#define _BSL_MockBPA_BPSECLIB_MockBPA_H_
#ifndef _BSL_MockBPA_MockBPA_H_
#define _BSL_MockBPA_MockBPA_H_

#include "bsl_mock_bpa_crc.h"
#include "bsl_mock_bpa_encode.h"
#include "bsl_mock_bpa_decode.h"
#include "bsl_mock_bpa_eidpat.h"
#include "bsl_mock_bpa.h"
#include "crc.h"
#include "encode.h"
#include "decode.h"
#include "agent.h"
#include "eidpat.h"

#endif //_BSL_MockBPA_BPSECLIB_MockBPA_H_
#endif //_BSL_MockBPA_MockBPA_H_
14 changes: 7 additions & 7 deletions src/mock_bpa/bsl_mock_bpa.c → src/mock_bpa/agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
#include <BPSecLib_Public.h>
#include <BPSecLib_Private.h>
#include <assert.h>
#include "bsl_mock_bpa.h"
#include "bsl_mock_bpa_eid.h"
#include "bsl_mock_bpa_eidpat.h"
#include "bsl_mock_bpa_encode.h"
#include "bsl_mock_bpa_decode.h"
#include "agent.h"
#include "eid.h"
#include "eidpat.h"
#include "encode.h"
#include "decode.h"

int MockBPA_Bundle_Deinit(MockBPA_Bundle_t *bundle)
{
Expand Down Expand Up @@ -261,7 +261,7 @@ int MockBPA_DeleteBundle(BSL_BundleRef_t *bundle_ref)
return 0;
}

int bsl_mock_bpa_init(void)
int bsl_mock_bpa_agent_init(void)
{
uint8_t *state = BSL_MALLOC(999);

Expand Down Expand Up @@ -292,7 +292,7 @@ int bsl_mock_bpa_init(void)
return BSL_HostDescriptors_Set(bpa);
}

void bsl_mock_bpa_deinit(void)
void bsl_mock_bpa_agent_deinit(void)
{
BSL_HostDescriptors_t bpa;
BSL_HostDescriptors_Get(&bpa);
Expand Down
4 changes: 2 additions & 2 deletions src/mock_bpa/bsl_mock_bpa.h → src/mock_bpa/agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ int MockBPA_DeleteBundle(BSL_BundleRef_t *bundle_ref);
/** Register this mock BPA for the current process.
* @return Zero if successful.
*/
int bsl_mock_bpa_init(void);
int bsl_mock_bpa_agent_init(void);

/** Clean up the mock BPA for the current process.
*/
void bsl_mock_bpa_deinit(void);
void bsl_mock_bpa_agent_deinit(void);

#ifdef __cplusplus
} // extern C
Expand Down
2 changes: 1 addition & 1 deletion src/mock_bpa/bsl_mock_bpa_crc.c → src/mock_bpa/crc.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Declarations for BPv7 block CRC handling.
*/

#include "bsl_mock_bpa_crc.h"
#include "crc.h"
#include <arpa/inet.h>
#include <inttypes.h>
#include <BPSecLib_Public.h>
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/mock_bpa/mock_bpa_ctr.c → src/mock_bpa/ctr.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
*/
#include <BPSecLib_Private.h>

#include "mock_bpa_ctr.h"
#include "bsl_mock_bpa_decode.h"
#include "bsl_mock_bpa_encode.h"
#include "ctr.h"
#include "decode.h"
#include "encode.h"

void mock_bpa_ctr_init(mock_bpa_ctr_t *ctr)
{
Expand Down
Loading