-
Notifications
You must be signed in to change notification settings - Fork 51
Closed
Description
Similar to the issue #65 there are a couple of codec helper functions that are using java pass-by-value paramateres instead of pointers and therefore not correctly passing back the length information.
Base64 to bin libsodium C code:
int
sodium_base642bin(unsigned char * const bin, const size_t bin_maxlen,
const char * const b64, const size_t b64_len,
const char * const ignore, size_t * const bin_len,
const char ** const b64_end, const int variant)
Lazysodium java code:
public native int sodium_base642bin(byte[] bin,
int binMaxLen,
byte[] b64,
int b64Len,
byte[] ignore,
int binLen,
byte b64End,
int variant);
If I am not mistaken parameter binLen should be of type Pointer like it was handled in this commit
The same situation is repeated for hex2bin
Libsodium C code:
int
sodium_hex2bin(unsigned char *const bin, const size_t bin_maxlen,
const char *const hex, const size_t hex_len,
const char *const ignore, size_t *const bin_len,
const char **const hex_end)
Lazysodium java code:
public native int sodium_hex2bin(byte[] bin,
int binMaxLen,
byte[] hex,
int hexLen,
byte[] ignore,
int binLen,
byte hexEnd);
Same paramater name, binLen
Metadata
Metadata
Assignees
Labels
No labels