| 1163 | } |
| 1164 | |
| 1165 | bool bolt12_bip353_valid_string(const u8 *str, size_t len) |
| 1166 | { |
| 1167 | /* BOLT #12: |
| 1168 | * - if `invreq_bip_353_name` is present: |
| 1169 | * - MUST reject the invoice request if `name` or `domain` |
| 1170 | * contain any bytes which are not `0`-`9`, `a`-`z`, |
| 1171 | * `A`-`Z`, `-`, `_` or `.`. |
| 1172 | */ |
| 1173 | for (size_t i = 0; i < len; i++) { |
| 1174 | if (cisalnum(str[i])) |
| 1175 | continue; |
| 1176 | if (str[i] == '-' || str[i] == '_' || str[i] == '.') |
| 1177 | continue; |
| 1178 | return false; |
| 1179 | } |
| 1180 | return true; |
| 1181 | } |
| 1182 | |
| 1183 | const struct recurrence *offer_recurrence(const struct tlv_offer *offer) |
| 1184 | { |
no test coverage detected