Skip to content

Commit

Permalink
preserve key order in order to be able to compare serialized JWTs
Browse files Browse the repository at this point in the history
_cjose_test_json_serial in check_jwe would fail with older versions of
Jansson that don't have the JSON_PRESERVE_ORDER flag set by default

Signed-off-by: Hans Zandbelt <[email protected]>
  • Loading branch information
zandbelt committed Oct 1, 2018
1 parent 46d238b commit 8342012
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jwe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@ char *cjose_jwe_export_json(cjose_jwe_t *jwe, cjose_err *err)
}
}

char *json_str = json_dumps(form, 0);
char *json_str = json_dumps(form, JSON_PRESERVE_ORDER);
if (NULL == json_str)
{
CJOSE_ERROR(err, CJOSE_ERR_NO_MEMORY);
Expand Down

0 comments on commit 8342012

Please sign in to comment.