Clean up base64_{encode,decode} pointer types

Allow any pointer to be used as source for encoding and use char * as
the return value from encoding and input value for decoding to reduce
number of type casts needed in the callers.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2019-11-27 15:55:33 +02:00 committed by Jouni Malinen
parent b22608423b
commit 8e5e36a184
19 changed files with 72 additions and 84 deletions

View file

@ -179,7 +179,7 @@ static TNC_Result TNC_TNCS_SendMessage(
TNC_MessageType messageType)
{
struct tncs_data *tncs;
unsigned char *b64;
char *b64;
size_t b64len;
wpa_printf(MSG_DEBUG, "TNC: TNC_TNCS_SendMessage(imvID=%lu "
@ -678,8 +678,7 @@ static unsigned char * tncs_get_base64(char *start, size_t *decoded_len)
return NULL;
*pos2 = '\0';
decoded = base64_decode((unsigned char *) pos, os_strlen(pos),
decoded_len);
decoded = base64_decode(pos, os_strlen(pos), decoded_len);
*pos2 = '<';
if (decoded == NULL) {
wpa_printf(MSG_DEBUG, "TNC: Failed to decode Base64 data");