Skip to content

Commit

Permalink
Fix: bad casting of pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Miller (mamille2) authored and linuxwolf committed Jan 20, 2017
1 parent 7d0f556 commit 5b7ac9a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/jws.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,13 @@ static bool _cjose_jws_build_sig_rs(cjose_jws_t *jws, const cjose_jwk_t *jwk, cj
return false;
}

if (RSA_sign(digest_alg, jws->dig, jws->dig_len, jws->sig, (unsigned int *)&jws->sig_len, (RSA *)jwk->keydata) != 1)
unsigned int siglen;
if (RSA_sign(digest_alg, jws->dig, jws->dig_len, jws->sig, &siglen, (RSA *)jwk->keydata) != 1)
{
CJOSE_ERROR(err, CJOSE_ERR_CRYPTO);
return false;
}
jws->sig_len = siglen;

// base64url encode signed digest
if (!cjose_base64url_encode((const uint8_t *)jws->sig, jws->sig_len, &jws->sig_b64u, &jws->sig_b64u_len, err))
Expand Down

0 comments on commit 5b7ac9a

Please sign in to comment.