Skip to content

Commit

Permalink
Address Scrutinice findings (#2121)
Browse files Browse the repository at this point in the history
### Issues:
Addresses P188794065

### Description of changes: 
* Cleanup a few issues identified through static anaylsis

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
  • Loading branch information
justsmth authored Jan 15, 2025
1 parent 94daeb2 commit 5276f78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions crypto/evp_extra/p_pqdsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ static int pkey_pqdsa_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) {
static int pkey_pqdsa_sign_message(EVP_PKEY_CTX *ctx, uint8_t *sig,
size_t *sig_len, const uint8_t *message,
size_t message_len) {
GUARD_PTR(sig_len);
PQDSA_PKEY_CTX *dctx = ctx->data;
const PQDSA *pqdsa = dctx->pqdsa;
if (pqdsa == NULL) {
Expand All @@ -71,10 +72,8 @@ static int pkey_pqdsa_sign_message(EVP_PKEY_CTX *ctx, uint8_t *sig,

// Caller is getting parameter values.
if (sig == NULL) {
if (sig_len != NULL) {
*sig_len = pqdsa->signature_len;
return 1;
}
*sig_len = pqdsa->signature_len;
return 1;
}

if (*sig_len != pqdsa->signature_len) {
Expand Down
2 changes: 1 addition & 1 deletion crypto/pkcs8/pkcs8_x509.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, const char *pass,
int pass_len_in, const uint8_t *salt, size_t salt_len,
int iterations, PKCS8_PRIV_KEY_INFO *p8inf) {
size_t pass_len;
if (pass_len_in == -1 && pass != NULL) {
if (pass_len_in < 0 && pass != NULL) {
pass_len = strlen(pass);
} else {
pass_len = (size_t)pass_len_in;
Expand Down

0 comments on commit 5276f78

Please sign in to comment.