opengnsys_ipxe/src/net
Michael Brown 1844aacc83 [uri] Retain original encodings for path, query, and fragment fields
iPXE decodes any percent-encoded characters during the URI parsing
stage, thereby allowing protocol implementations to consume the raw
field values directly without further decoding.

When reconstructing a URI string for use in an HTTP request line, the
percent-encoding is currently reapplied in a reversible way: we
guarantee that our reconstructed URI string could be decoded to give
the same raw field values.

This technically violates RFC3986, which states that "URIs that differ
in the replacement of a reserved character with its corresponding
percent-encoded octet are not equivalent".  Experiments show that
several HTTP server applications will attach meaning to the choice of
whether or not a particular character was percent-encoded, even when
the percent-encoding is unnecessary from the perspective of parsing
the URI into its component fields.

Fix by storing the originally encoded substrings for the path, query,
and fragment fields and using these original encoded versions when
reconstructing a URI string.  The path field is also stored as a
decoded string, for use by protocols such as TFTP that communicate
using raw strings rather than URI-encoded strings.  All other fields
(such as the username and password) continue to be stored only in
their decoded versions since nothing ever needs to know the originally
encoded versions of these fields.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2021-11-12 09:58:29 +00:00
..
80211 [eapol] Replace EAPoL code 2021-01-19 13:01:43 +00:00
infiniband [infiniband] Require drivers to specify the number of ports 2021-01-27 01:15:35 +00:00
oncrpc [nfs] Rewrite NFS URI handling 2014-05-18 21:53:39 +01:00
tcp [uri] Retain original encodings for path, query, and fragment fields 2021-11-12 09:58:29 +00:00
udp [dhcp] Handle DHCPNAK by returning to discovery state 2021-03-11 16:04:19 +00:00
aoe.c [aoe] Allow AoE device to be described using an EFI device path 2020-10-19 14:45:49 +01:00
arp.c [arp] Validate length of ARP packet 2016-03-12 01:24:03 +00:00
dhcpopts.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:50:42 +00:00
dhcppkt.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
eap.c [eap] Treat an EAP Request-Identity as indicating a blocked link 2021-01-19 13:01:46 +00:00
eapol.c [eap] Treat an EAP Request-Identity as indicating a blocked link 2021-01-19 13:01:46 +00:00
eth_slow.c [lacp] Ignore (and do not echo) trailing padding on received packets 2020-10-14 14:18:49 +01:00
ethernet.c [ethernet] Avoid false positive Coverity warning 2019-08-17 17:30:09 +01:00
fakedhcp.c [pxe] Populate ciaddr in fake PXE Boot Server ACK packet 2015-09-01 21:24:02 +01:00
fc.c [build] Fix the REQUIRE_SYMBOL mechanism 2015-03-05 00:59:38 +00:00
fcels.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
fcns.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
fcoe.c [time] Allow timer to be selected at runtime 2017-01-26 08:17:37 +00:00
fcp.c [fcp] Allow Fibre Channel device to be described using an EFI device path 2020-10-22 14:16:55 +01:00
fragment.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
icmp.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
icmpv4.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
icmpv6.c [ipv6] Disambiguate received ICMPv6 errors 2015-05-11 12:45:14 +01:00
infiniband.c [infiniband] Require drivers to specify the number of ports 2021-01-27 01:15:35 +00:00
iobpad.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
ipv4.c [ipv4] Accept unicast packets for the local network broadcast address 2017-01-22 09:12:52 +00:00
ipv6.c [ipv6] Allow for multiple routers 2016-07-25 15:20:22 +01:00
ndp.c [ipv6] Defer router discovery timeout while link is blocked 2021-01-19 14:15:56 +00:00
neighbour.c [neighbour] Return success when deferring a packet 2015-05-20 15:29:36 +01:00
netdev_settings.c [netdevice] Add "hwaddr" setting 2017-09-06 10:52:30 +01:00
netdevice.c [netdevice] Ensure driver transmit() and poll() will not be re-entered 2021-04-10 16:53:52 +01:00
nullnet.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
pccrc.c [peerdist] Include trimmed range within content information block 2015-07-28 15:22:26 +01:00
pccrd.c [peerdist] Add support for constructing and decoding discovery messages 2015-07-28 16:09:14 +01:00
peerblk.c [peerdist] Limit number of concurrent raw block downloads 2019-08-16 22:19:50 +01:00
peerdisc.c [peerdist] Assume that most recently discovered peer can be reused 2021-06-22 09:45:21 +01:00
peerdist.c [peerdist] Allow PeerDist to be globally enabled or disabled 2019-12-13 14:44:22 +00:00
peermux.c [peerdist] Gather and report peer statistics during download 2017-09-05 23:23:22 +01:00
ping.c [xfer] Remove address family from definition of a socket opener 2020-07-15 18:46:58 +01:00
rarp.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
retry.c [retry] Colourise debug output 2015-03-05 11:25:54 +00:00
rndis.c [rndis] Clean up error handling path in register_rndis() 2018-07-09 10:35:57 +01:00
socket.c [legal] Relicense files under GPL2_OR_LATER_OR_UBDL 2015-03-02 14:17:31 +00:00
stp.c [time] Allow timer to be selected at runtime 2017-01-26 08:17:37 +00:00
tcp.c [xfer] Remove address family from definition of a socket opener 2020-07-15 18:46:58 +01:00
tcpip.c [netdevice] Limit MTU by hardware maximum frame length 2017-01-25 14:55:09 +00:00
tls.c [crypto] Allow private key to be specified as a TLS connection parameter 2020-12-15 16:54:06 +00:00
udp.c [xfer] Remove address family from definition of a socket opener 2020-07-15 18:46:58 +01:00
validator.c [x509] Make root of trust a reference-counted structure 2020-12-09 16:45:50 +00:00
vlan.c [vlan] Provide vlan_netdev_rx() and vlan_netdev_rx_err() 2019-04-27 20:25:00 +01:00