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

cmd: Fix initialization of arguments buffer #418

Merged
merged 2 commits into from
Aug 28, 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
2 changes: 1 addition & 1 deletion lib/scp.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

#define SCP_AUTHKEY_ID_LEN 2

#define SCP_MSG_BUF_SIZE 3136
#define SCP_MSG_BUF_SIZE 3136 // Hard limit on the firmware side

// Message
#pragma pack(push, 1)
Expand Down
8 changes: 4 additions & 4 deletions resources/tests/bash/test_wrapkey.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,13 @@ for k in ${RSA_KEYSIZE[@]}; do
echo " RSA$k"
echo "**********************************"
echo "=== Generate RSA wrap keys"
test_with_resp "$BIN -p password -a generate-wrap-key -i 0 -l wrapkey -c import-wrapped --delegated all -A rsa$k" " Generate RSA wrap key"
test_with_resp "$BIN -p password -a generate-wrap-key -i 0 -l wrapkey -c import-wrapped --delegated exportable-under-wrap,sign-ecdsa,encrypt-cbc,decrypt-cbc -A rsa$k" " Generate RSA wrap key"
keyid=$(tail -1 resp.txt | awk '{print $4}')
info=$($BIN -p password -a get-object-info -i $keyid -t wrap-key 2> /dev/null)
cmp_str_content "$info" "algorithm: rsa$k" "Algorithm"
cmp_str_content "$info" "origin: generated" "Origin"
test "$BIN -p password -a get-public-key -i $keyid -t wrap-key --out public_wrapkey.pem" " Export rsa public wrap key"
test "$BIN -p password -a put-public-wrapkey -i $keyid -c export-wrapped --delegated all --in public_wrapkey.pem" " Import RSA public wrap key"
test "$BIN -p password -a put-public-wrapkey -i $keyid -c export-wrapped --delegated exportable-under-wrap,sign-ecdsa,encrypt-cbc,decrypt-cbc --in public_wrapkey.pem" " Import RSA public wrap key"
rm public_wrapkey.pem

echo "=== Wrap and unwrap EC object with generated RSA wrap key"
Expand Down Expand Up @@ -315,12 +315,12 @@ for k in ${RSA_KEYSIZE[@]}; do
echo "=== Import RSA wrap keys"
test "openssl genrsa -out keypair.pem $k" " Generate RSA key with OpenSSL"
test "openssl rsa -in keypair.pem -pubout -out key.pub" " Extract public key from OpenSSL generated keypair"
test_with_resp "$BIN -p password -a put-rsa-wrapkey -i 0 -d 1 -c import-wrapped --delegated all --in keypair.pem" " Import RSA wrap key"
test_with_resp "$BIN -p password -a put-rsa-wrapkey -i 0 -d 1 -c import-wrapped --delegated exportable-under-wrap,sign-ecdsa,encrypt-cbc,decrypt-cbc --in keypair.pem" " Import RSA wrap key"
import_keyid=$(tail -1 resp.txt | awk '{print $4}')
info=$($BIN -p password -a get-object-info -i $import_keyid -t wrap-key 2> /dev/null)
cmp_str_content "$info" "algorithm: rsa$k" "Algorithm"
cmp_str_content "$info" "origin: imported" "Origin"
test "$BIN -p password -a put-public-wrapkey -i $import_keyid -c export-wrapped --delegated all --in key.pub" " Import RSA public wrap key"
test "$BIN -p password -a put-public-wrapkey -i $import_keyid -c export-wrapped --delegated exportable-under-wrap,sign-ecdsa,encrypt-cbc,decrypt-cbc --in key.pub" " Import RSA public wrap key"
rm keypair.pem
rm key.pub

Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2079,7 +2079,7 @@ int main(int argc, char *argv[]) {
}
}

Argument arg[11];
Argument arg[11] = {0};

if (requires_session == true) {
uint8_t *buf = 0;
Expand Down
Loading