File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -1552,11 +1552,21 @@ bool AWSv4ComplMulti::complete()
15521552 std::string_view expected_trailer_signature;
15531553 std::string calculated_trailer_signature;
15541554
1555- /* the trailer boundary is just "\r\n0" when we have no trailer
1556- * signature */
1555+ /* I have seen variations in the 0-byte case, with and without
1556+ * ssl transport. I have observed "\r\n0;" but also "0;" in the
1557+ * trailer-signature case. I have observed only "\r\n0" in the
1558+ * no-trailer-signature case--but assume "0" might be possible.
1559+ * The logic below handles all 4 cases. */
15571560 if (tbuf_pos > sarrlen (" \r\n 0" )) {
1558- auto trailer_off = sarrlen (" \r\n 0" );
1559- if (*(trailer_vec.data () + trailer_off) == ' ;' ) {
1561+ const char * tv_data = trailer_vec.data ();
1562+ auto trailer_off = 0 ;
1563+ if (*(tv_data + trailer_off) == ' \r ' ) {
1564+ trailer_off += 2 ;
1565+ }
1566+ if (*(tv_data + trailer_off) == ' 0' ) {
1567+ ++trailer_off;
1568+ }
1569+ if (*(tv_data + trailer_off) == ' ;' ) {
15601570 ++trailer_off;
15611571 }
15621572 const std::string_view sv_trailer (
You can’t perform that action at this time.
0 commit comments