Lines Matching refs:macaroon
155 bool uw_macaroon_validate_(const UwMacaroon* macaroon, in uw_macaroon_validate_() argument
165 if (root_key == NULL || root_key_len == 0 || macaroon == NULL || in uw_macaroon_validate_()
167 !verify_mac_tag_(root_key, root_key_len, context, macaroon->caveats, in uw_macaroon_validate_()
168 macaroon->num_caveats, macaroon->mac_tag)) { in uw_macaroon_validate_()
176 for (size_t i = 0; i < macaroon->num_caveats; i++) { in uw_macaroon_validate_()
177 if (!uw_macaroon_caveat_validate_(macaroon->caveats[i], context, &state, in uw_macaroon_validate_()
189 bool uw_macaroon_serialize_(const UwMacaroon* macaroon, in uw_macaroon_serialize_() argument
193 if (macaroon == NULL || out == NULL || in uw_macaroon_serialize_()
206 if (!uw_macaroon_encoding_encode_array_len_((uint32_t)(macaroon->num_caveats), in uw_macaroon_serialize_()
213 for (size_t i = 0; i < macaroon->num_caveats; i++) { in uw_macaroon_serialize_()
215 macaroon->caveats[i]->bytes, macaroon->caveats[i]->num_bytes, in uw_macaroon_serialize_()
222 if (!uw_macaroon_encoding_encode_byte_str_(macaroon->mac_tag, in uw_macaroon_serialize_()
249 UwMacaroon* macaroon) { in uw_macaroon_deserialize_() argument
251 macaroon == NULL) { in uw_macaroon_deserialize_()
277 macaroon->num_caveats = (size_t)array_len; in uw_macaroon_deserialize_()
308 macaroon->caveats = caveat_pointers; in uw_macaroon_deserialize_()
317 memcpy(macaroon->mac_tag, tag, UW_MACAROON_MAC_LEN); in uw_macaroon_deserialize_()