27 virtual bool do_match(
28 _In_reads_or_z_opt_(end)
const char* text,
29 _In_
size_t start = 0,
30 _In_
size_t end = SIZE_MAX,
31 _In_
int flags = stdex::parser::match_default)
33 _Unreferenced_(flags);
34 stdex_assert(text || start + 17 >= end);
35 if (start + 17 < end &&
36 text[start + 0] ==
'u' &&
37 text[start + 1] ==
'n' &&
38 text[start + 2] ==
't' &&
39 text[start + 3] ==
'r' &&
40 text[start + 4] ==
'u' &&
41 text[start + 5] ==
's' &&
42 text[start + 6] ==
't' &&
43 text[start + 7] ==
'e' &&
44 text[start + 8] ==
'd' &&
45 text[start + 9] ==
' ' &&
46 text[start + 10] ==
'c' &&
47 text[start + 11] ==
'o' &&
48 text[start + 12] ==
'm' &&
49 text[start + 13] ==
'm' &&
50 text[start + 14] ==
'e' &&
51 text[start + 15] ==
'n' &&
52 text[start + 16] ==
't' &&
53 text[start + 17] ==
':')
69 virtual bool do_match(
70 _In_reads_or_z_opt_(end)
const char* text,
71 _In_
size_t start = 0,
72 _In_
size_t end = SIZE_MAX,
73 _In_
int flags = stdex::parser::match_default)
75 _Unreferenced_(flags);
76 stdex_assert(text || start + 1 >= end);
77 if (start + 1 < end &&
78 text[start + 0] ==
'\r' &&
79 text[start + 1] ==
'\n')
84 stdex_assert(text || start >= end);
85 if (start < end && text[start] ==
'\n') {
102 inline void parse_minisig(_Inout_
stdex::stream::basic& minisig, _Out_ uint8_t& algorithm, _Out_writes_all_(8) uint8_t key_id[8], _Out_writes_all_(64) uint8_t signature[64])
104 std::vector<uint8_t> data;
108 minisig.readln(line);
115 decoder.
decode(data, is_last, line.data(), line.size());
118 if (data.size() < 74)
119 throw std::runtime_error(
"Minisign signature is too short");
121 throw std::runtime_error(
"not a Minisign signature");
123 memcpy(&key_id[0], &data[2], 8);
124 memcpy(&signature[0], &data[10], 64);
Base64 decoding session.
Definition base64.hpp:275
void decode(std::vector< T_to, AX > &out, bool &is_last, const T_from *data, size_t size)
Decodes one block of information, and appends it to the output.
Definition base64.hpp:297
Test for CRLF or LF.
Definition minisign.hpp:67
Basic stream operations.
Definition stream.hpp:85
Numerical interval.
Definition interval.hpp:18
T end
interval end
Definition interval.hpp:20
void invalidate()
Invalidates interval.
Definition interval.hpp:59
T start
interval start
Definition interval.hpp:19