1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

jws: compact representation helper must use dots

This commit is contained in:
Andy Green 2020-07-10 15:25:16 +01:00
parent 0371f8341d
commit a984563129

View file

@ -934,9 +934,15 @@ lws_jws_write_compact(struct lws_jws *jws, char *compact, size_t len)
lws_strnncpy(compact + n, jws->map_b64.buf[LJWS_JOSE],
jws->map_b64.len[LJWS_JOSE], len - n);
n += strlen(compact + n);
if (n >= len - 1)
return 1;
compact[n++] = '.';
lws_strnncpy(compact + n, jws->map_b64.buf[LJWS_PYLD],
jws->map_b64.len[LJWS_PYLD], len - n);
n += strlen(compact + n);
if (n >= len - 1)
return 1;
compact[n++] = '.';
lws_strnncpy(compact + n, jws->map_b64.buf[LJWS_SIG],
jws->map_b64.len[LJWS_SIG], len - n);
n += strlen(compact + n);