Lines Matching refs:alg

76 	case LJWSJT_PROTECTED:  /* base64u: JOSE: must contain 'alg' */
105 * and we can't do it until we see the protected alg.
465 temp, &temp_len) < 0 || !jose.alg) {
470 if (!strcmp(jose.alg->alg, "none")) {
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,
596 /* key must match the selected alg curve */
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__);
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),
832 /* key must match the selected alg curve */
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,
993 * Insist to see an alg in there that we list as acceptable
998 n = strlen(jose.alg->alg);
1003 !strncmp(jose.alg->alg, ts.token, ts.token_len))
1008 lwsl_err("%s: JOSE using alg %s (accepted: %s)\n", __func__,
1009 jose.alg->alg, alg_list);
1013 /* we liked the alg... now how about the crypto? */
1061 * minimal header from info->alg
1064 10 + strlen(info->alg);
1078 /* get algorithm from 'alg' string and write minimal JOSE header */
1079 if (lws_gencrypto_jws_alg_to_definition(info->alg, &jose.alg)) {
1080 lwsl_err("%s: unknown alg %s\n", __func__, info->alg);
1086 "{\"alg\":\"%s\"}", info->alg);
1198 const char *alg, char *out, size_t *out_len, char *temp,
1202 .alg = alg,