| 880 | } |
| 881 | |
| 882 | bool bolt12_bip353_valid_string(const u8 *str, size_t len) |
| 883 | { |
| 884 | /* BOLT #12: |
| 885 | * - if `invreq_bip_353_name` is present: |
| 886 | * - MUST reject the invoice request if `name` or `domain` |
| 887 | * contain any bytes which are not `0`-`9`, `a`-`z`, |
| 888 | * `A`-`Z`, `-`, `_` or `.`. |
| 889 | */ |
| 890 | for (size_t i = 0; i < len; i++) { |
| 891 | if (cisalnum(str[i])) |
| 892 | continue; |
| 893 | if (str[i] == '-' || str[i] == '_' || str[i] == '.') |
| 894 | continue; |
| 895 | return false; |
| 896 | } |
| 897 | return true; |
| 898 | } |
| 899 | |
| 900 | const struct recurrence *offer_recurrence(const struct tlv_offer *offer) |
| 901 | { |
no test coverage detected