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

Minor updates for conformance #82

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions src/base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,20 +229,20 @@ static inline bool _encode(const uint8_t *input, size_t inlen, char **output, si

// interface functions

bool cjose_base64_encode(const uint8_t *input, size_t inlen, char **output, size_t *outlen, cjose_err *err)
bool cjose_base64_encode(const uint8_t *input, const size_t inlen, char **output, size_t *outlen, cjose_err *err)
{
return _encode(input, inlen, output, outlen, ALPHABET_B64, err);
}
bool cjose_base64url_encode(const uint8_t *input, size_t inlen, char **output, size_t *outlen, cjose_err *err)
bool cjose_base64url_encode(const uint8_t *input, const size_t inlen, char **output, size_t *outlen, cjose_err *err)
{
return _encode(input, inlen, output, outlen, ALPHABET_B64U, err);
}

bool cjose_base64_decode(const char *input, size_t inlen, uint8_t **output, size_t *outlen, cjose_err *err)
bool cjose_base64_decode(const char *input, const size_t inlen, uint8_t **output, size_t *outlen, cjose_err *err)
{
return _decode(input, inlen, output, outlen, false, err);
}
bool cjose_base64url_decode(const char *input, size_t inlen, uint8_t **output, size_t *outlen, cjose_err *err)
bool cjose_base64url_decode(const char *input, const size_t inlen, uint8_t **output, size_t *outlen, cjose_err *err)
{
return _decode(input, inlen, output, outlen, true, err);
}
2 changes: 1 addition & 1 deletion src/include/concatkdf_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <cjose/header.h>

bool cjose_concatkdf_create_otherinfo(const char *alg,
size_t keylen,
const size_t keylen,
cjose_header_t *hdr,
uint8_t **otherinfo, size_t *otherinfoLen,
cjose_err *err);
Expand Down
4 changes: 2 additions & 2 deletions src/jws.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ static bool _cjose_jws_build_hdr(cjose_jws_t *jws, cjose_header_t *header, cjose
}
if (!cjose_base64url_encode((const uint8_t *)hdr_str, strlen(hdr_str), &jws->hdr_b64u, &jws->hdr_b64u_len, err))
{
free(hdr_str);
cjose_get_dealloc()(hdr_str);
return false;
}
free(hdr_str);
cjose_get_dealloc()(hdr_str);

return true;
}
Expand Down