From 5b7ac9a6dfd08aead145dcef7a46bbc52ffb68de Mon Sep 17 00:00:00 2001 From: "Matt Miller (mamille2)" Date: Fri, 20 Jan 2017 09:50:57 -0700 Subject: [PATCH] Fix: bad casting of pointers --- src/jws.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jws.c b/src/jws.c index 88e4289..b09c807 100644 --- a/src/jws.c +++ b/src/jws.c @@ -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))