Skip to content

Commit

Permalink
Merge pull request cisco#3 from ajishna/master
Browse files Browse the repository at this point in the history
Minor updates for conformance
  • Loading branch information
zandbelt authored Apr 5, 2022
2 parents e9c4a8c + eed819f commit 86d604b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
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

0 comments on commit 86d604b

Please sign in to comment.