Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f424086
cleanup ec loading
DmitriyMusatkin Oct 10, 2025
d9ad56a
fix
DmitriyMusatkin Oct 13, 2025
46b8cf8
test and win build fix
DmitriyMusatkin Oct 13, 2025
9329072
lint
DmitriyMusatkin Oct 13, 2025
04de02c
test fix
DmitriyMusatkin Oct 13, 2025
e1022e4
fix
DmitriyMusatkin Oct 13, 2025
dfb363a
Add codecov
DmitriyMusatkin Oct 13, 2025
d55902c
wrong name
DmitriyMusatkin Oct 13, 2025
33df892
docs
DmitriyMusatkin Oct 13, 2025
cffe68d
Merge branch 'main' into ec_pkcs8
DmitriyMusatkin Oct 13, 2025
0b6a6d3
add pkcs8 parsing test
DmitriyMusatkin Oct 13, 2025
21deb54
address comments
DmitriyMusatkin Oct 14, 2025
0e9cbd5
small refactor
DmitriyMusatkin Oct 14, 2025
0330000
test fix
DmitriyMusatkin Oct 14, 2025
aa69808
zero
DmitriyMusatkin Oct 14, 2025
04c33c9
loggin:
DmitriyMusatkin Oct 14, 2025
398dca0
revert
DmitriyMusatkin Oct 14, 2025
853480d
fix lc
DmitriyMusatkin Oct 14, 2025
d1d2990
gen pub if missing
DmitriyMusatkin Oct 14, 2025
622aa13
remove for now
DmitriyMusatkin Oct 14, 2025
07cc6a8
logs
DmitriyMusatkin Oct 14, 2025
b9515f5
set pub
DmitriyMusatkin Oct 14, 2025
c35d64a
fix and lint
DmitriyMusatkin Oct 14, 2025
7b9a83d
typo
DmitriyMusatkin Oct 14, 2025
ac70d69
restore advance fix
DmitriyMusatkin Oct 15, 2025
efbb69e
Update source/unix/opensslcrypto_ecc.c
DmitriyMusatkin Oct 16, 2025
cbd51fb
addressing comments
DmitriyMusatkin Oct 16, 2025
255dfd7
address comments
DmitriyMusatkin Oct 16, 2025
f05bd77
Merge branch 'main' into ec_pkcs8
DmitriyMusatkin Oct 16, 2025
160e398
error preconditions
DmitriyMusatkin Oct 16, 2025
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
32 changes: 32 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Code coverage check

on:
push:

env:
BUILDER_VERSION: v0.9.74
BUILDER_SOURCE: releases
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-c-cal
RUN: ${{ github.run_id }}-${{ github.run_number }}
CRT_CI_ROLE: ${{ secrets.CRT_CI_ROLE_ARN }}
AWS_DEFAULT_REGION: us-east-1

permissions:
id-token: write # This is required for requesting the JWT

jobs:
codecov-linux:
runs-on: ubuntu-24.04
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.CRT_CI_ROLE }}
aws-region: ${{ env.AWS_DEFAULT_REGION }}
- name: Checkout Sources
uses: actions/checkout@v4
- name: Build ${{ env.PACKAGE_NAME }} + consumers
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }} --compiler=gcc --cmake-extra=-DASSERT_LOCK_HELD=ON --coverage
Comment on lines +30 to +32
Copy link
Contributor

@TingDaoK TingDaoK Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 > aws --region us-east-1 secretsmanager get-secret-value --secret-id codecov-token
No token found for aws-c-cal, check https://app.codecov.io/github/awslabs/aws-c-cal/settings for token and add it to codecov-token in secret-manager.

This actually failed, but I didn't have the non-zero exit code in the builder...

Should be fixed by awslabs/aws-crt-builder#340

Also, I put the token in the secrete manager now, so it should work now.

6 changes: 6 additions & 0 deletions include/aws/cal/private/der.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ AWS_CAL_API void aws_der_decoder_destroy(struct aws_der_decoder *decoder);
*/
AWS_CAL_API bool aws_der_decoder_next(struct aws_der_decoder *decoder);

/**
* Resets der decoder to the start.
* @param decoder The decoder to reset
*/
AWS_CAL_API void aws_der_decoder_reset(struct aws_der_decoder *decoder);

/**
* The type of the current TLV
* @param decoder The decoder to inspect
Expand Down
10 changes: 8 additions & 2 deletions include/aws/cal/private/ecc.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,16 @@ struct aws_der_decoder;

AWS_EXTERN_C_BEGIN

/*
* Helper to load keypair from various ASN1 format.
* Note: there are several formats in the wild: Sec1 and PKCS8 for private key and X509 for public key.
* This function attempts to automatically recognize the format and load from it.
* Depending on data available in the asn, either private or public key might remain uninitialized.
*/
AWS_CAL_API int aws_der_decoder_load_ecc_key_pair(
struct aws_der_decoder *decoder,
struct aws_byte_cursor *out_public_x_coor,
struct aws_byte_cursor *out_public_y_coor,
struct aws_byte_cursor *out_public_x_coord,
struct aws_byte_cursor *out_public_y_coord,
struct aws_byte_cursor *out_private_d,
enum aws_ecc_curve_name *out_curve_name);

Expand Down
4 changes: 4 additions & 0 deletions source/der.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ bool aws_der_decoder_next(struct aws_der_decoder *decoder) {
return (++decoder->tlv_idx < (int)decoder->tlvs.length);
}

void aws_der_decoder_reset(struct aws_der_decoder *decoder) {
decoder->tlv_idx = 0;
}

static struct der_tlv s_decoder_tlv(struct aws_der_decoder *decoder) {
AWS_FATAL_ASSERT(decoder->tlv_idx < (int)decoder->tlvs.length);
struct der_tlv tlv = {0};
Expand Down
Loading