Lines Matching defs:jose
26 #include "private-lib-jose-jws.h"
177 /* no need to scrub first jose header element (it can be canned then) */
456 struct lws_jose jose;
458 lws_jose_init(&jose);
464 if (lws_jws_parse_jose(&jose, map->buf[LJWS_JOSE], (int)map->len[LJWS_JOSE],
465 temp, &temp_len) < 0 || !jose.alg) {
470 if (!strcmp(jose.alg->alg, "none")) {
471 /* "none" compact serialization has 2 blocks: jose.payload */
479 /* all other have 3 blocks: jose.payload.sig */
485 switch (jose.alg->algtype_signing) {
499 if (lws_genhash_init(&hash_ctx, jose.alg->hash_type))
519 // h_len = lws_genhash_size(jose.alg->hash_type);
529 jose.alg->hash_type,
545 h_len = (int)lws_genhmac_size(jose.alg->hmac_type);
549 if (lws_genhmac_init(&ctx, jose.alg->hmac_type,
598 jose.alg->curve_name))
620 if (lws_genhash_init(&hash_ctx, jose.alg->hash_type) ||
632 h_len = (int)lws_genhash_size(jose.alg->hash_type);
647 jose.alg->hash_type,
648 jose.alg->keybits_fixed,
660 lwsl_err("%s: unknown alg from jose\n", __func__);
741 lws_jws_sign_from_b64(struct lws_jose *jose, struct lws_jws *jws,
752 if (jose->alg->hash_type == LWS_GENHASH_TYPE_UNKNOWN &&
753 jose->alg->hmac_type == LWS_GENHMAC_TYPE_UNKNOWN &&
754 !strcmp(jose->alg->alg, "none"))
757 if (lws_genhash_init(&hash_ctx, jose->alg->hash_type) ||
769 switch (jose->alg->algtype_signing) {
791 n = lws_genrsa_hash_sign(&rsactx, digest, jose->alg->hash_type,
811 lws_genhash_size(jose->alg->hash_type),
835 jose->alg->curve_name))
849 m = lws_gencrypto_bits_to_bytes(jose->alg->keybits_fixed) * 2;
855 jose->alg->hash_type,
856 jose->alg->keybits_fixed,
959 struct lws_jose jose;
965 lws_jose_init(&jose);
986 if (lws_jws_parse_jose(&jose, jws.map.buf[LJWS_JOSE],
998 n = strlen(jose.alg->alg);
1003 !strncmp(jose.alg->alg, ts.token, ts.token_len))
1009 jose.alg->alg, alg_list);
1037 lws_jose_destroy(&jose);
1046 struct lws_jose jose;
1054 lws_jose_init(&jose);
1079 if (lws_gencrypto_jws_alg_to_definition(info->alg, &jose.alg)) {
1093 if (lws_jws_parse_jose(&jose, info->jose_hdr,
1095 lwsl_err("%s: invalid jose header\n", __func__);
1152 n = lws_jws_sign_from_b64(&jose, &jws,
1176 lws_jose_destroy(&jose);