Skip to content

Commit

Permalink
aws: remove new line from test b64 encode
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfala committed Dec 3, 2021
1 parent c4f9cff commit b962cfd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/internal/aws_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ static void flb_aws_compress_general_test_cases(int test_type,
}

/* B64 check script copied from Monkey Auth Plugin */
/* Change log:
* Removed auto new line entry from every 72 characters to make consistant with
* the actual base64 conversion
*/
/* Copied from monkey/plugins/auth/base64.c */

#include <monkey/mk_api.h>
Expand Down Expand Up @@ -359,7 +363,7 @@ static unsigned char * base64_encode(const unsigned char *src, size_t len,
unsigned char *out, *pos;
const unsigned char *end, *in;
size_t olen;
int line_len;
size_t line_len;

olen = len * 4 / 3 + 4; /* 3-byte blocks to 4-byte */
olen += olen / 72; /* line feeds */
Expand Down Expand Up @@ -387,10 +391,6 @@ static unsigned char * base64_encode(const unsigned char *src, size_t len,
*pos++ = base64_table[in[2] & 0x3f];
in += 3;
line_len += 4;
if (line_len >= 72) {
*pos++ = '\n';
line_len = 0;
}
}

if (end - in) {
Expand Down

0 comments on commit b962cfd

Please sign in to comment.