You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sxg_codec.c uses BIO_f_base64 for base 64 encoding, but BoringSSL lists this function as deprecated:
// Deprecated functions.
|
| // BIO_f_base64 returns a filter \|BIO\| that base64-encodes data written into
| // it, and decodes data read from it. \|BIO_gets\| is not supported. Call
| // \|BIO_flush\| when done writing, to signal that no more data are to be
| // encoded. The flag \|BIO_FLAGS_BASE64_NO_NL\| may be set to encode all the data
| // on one line.
| //
| // Use \|EVP_EncodeBlock\| and \|EVP_DecodeBase64\| instead.
| OPENSSL_EXPORT const BIO_METHOD *BIO_f_base64(void);
Any chance we could replace the calls in libsxg with EVP_EncodeBlock/EVP_DecodeBase64 as the comments in BoringSSL suggest?
was able to implement a version of sxg_base64encode_bytes with EVP_EncodeBlock that passes tests:
bool sxg_base64encode_bytes(const uint8_t* src, size_t length,
size_t ol;
// note that the length calcualted by EVP_EncodedLength includes the trailing
// null byte, but the value returned by EVP_EncodeBlock does not.
return EVP_EncodedLength(&ol, length) &&
sxg_buffer_resize(ol - 1, dst) &&
EVP_EncodeBlock(dst->data, src, length) == ol - 1;
}
issue is that OpenSSL doesn't seem to have EV_EncodedLength and its version of EVP_EncodeBlock returns an int, so if we wanted to have a single implementation for both versions of OpenSSL, we would need to work around the inconsistencies. This is easy enough, since the openssl docs describe the algorithm used by EV_EncodedLength, and length can be cast to the write type for comparison.
sxg_codec.c uses
BIO_f_base64
for base 64 encoding, but BoringSSL lists this function as deprecated:Any chance we could replace the calls in libsxg with
EVP_EncodeBlock
/EVP_DecodeBase64
as the comments in BoringSSL suggest?cc @twifkak @rgs1
The text was updated successfully, but these errors were encountered: