From 1844aacc837bf81cb1959fa65f2e52dcc70a0cae Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 11 Nov 2021 23:31:23 +0000 Subject: [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 --- src/usr/imgmgmt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/usr') diff --git a/src/usr/imgmgmt.c b/src/usr/imgmgmt.c index f8d149153..b7fc8293d 100644 --- a/src/usr/imgmgmt.c +++ b/src/usr/imgmgmt.c @@ -58,8 +58,8 @@ int imgdownload ( struct uri *uri, unsigned long timeout, memcpy ( &uri_redacted, uri, sizeof ( uri_redacted ) ); uri_redacted.user = NULL; uri_redacted.password = NULL; - uri_redacted.query = NULL; - uri_redacted.fragment = NULL; + uri_redacted.equery = NULL; + uri_redacted.efragment = NULL; uri_string_redacted = format_uri_alloc ( &uri_redacted ); if ( ! uri_string_redacted ) { rc = -ENOMEM; -- cgit v1.2.3-55-g7522 From 53a5de3641ccd0836aac7378cdd37c9757e2db3a Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 13 Jan 2022 12:48:38 +0000 Subject: [doc] Update user-visible ipxe.org URIs to use HTTPS Signed-off-by: Michael Brown --- src/Makefile | 2 +- src/arch/x86/interface/syslinux/comboot_call.c | 2 +- src/arch/x86/prefix/romprefix.S | 4 ++-- src/config/branding.h | 24 ++++++++++++------------ src/include/ipxe/srp.h | 2 +- src/usr/autoboot.c | 4 ++-- src/util/niclist.pl | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/usr') diff --git a/src/Makefile b/src/Makefile index 69139dc11..4c4abf1aa 100644 --- a/src/Makefile +++ b/src/Makefile @@ -190,7 +190,7 @@ vmware : bin/8086100f.mrom bin/808610d3.mrom bin/10222000.rom bin/15ad07b0.rom @$(ECHO) ' bin/10222000.rom -- vlance/pcnet32' @$(ECHO) ' bin/15ad07b0.rom -- vmxnet3' @$(ECHO) - @$(ECHO) 'For more information, see http://ipxe.org/howto/vmware' + @$(ECHO) 'For more information, see https://ipxe.org/howto/vmware' @$(ECHO) @$(ECHO) '===========================================================' diff --git a/src/arch/x86/interface/syslinux/comboot_call.c b/src/arch/x86/interface/syslinux/comboot_call.c index dc308dafe..b75e8ef7c 100644 --- a/src/arch/x86/interface/syslinux/comboot_call.c +++ b/src/arch/x86/interface/syslinux/comboot_call.c @@ -47,7 +47,7 @@ static char __bss16_array ( syslinux_version, [32] ); #define syslinux_version __use_data16 ( syslinux_version ) /** The "SYSLINUX" copyright string */ -static char __data16_array ( syslinux_copyright, [] ) = " http://ipxe.org"; +static char __data16_array ( syslinux_copyright, [] ) = " https://ipxe.org"; #define syslinux_copyright __use_data16 ( syslinux_copyright ) static char __data16_array ( syslinux_configuration_file, [] ) = ""; diff --git a/src/arch/x86/prefix/romprefix.S b/src/arch/x86/prefix/romprefix.S index a9934a725..4e8793c21 100644 --- a/src/arch/x86/prefix/romprefix.S +++ b/src/arch/x86/prefix/romprefix.S @@ -161,7 +161,7 @@ pnpheader: /* Manufacturer string */ mfgstr: - .asciz "http://ipxe.org" + .asciz "https://ipxe.org" .size mfgstr, . - mfgstr /* Product string @@ -607,7 +607,7 @@ get_pmm_decompress_to: * strings PRODUCT_NAME and PRODUCT_SHORT_NAME in config/branding.h. * * While nothing in the GPL prevents you from removing all references - * to iPXE or http://ipxe.org, we prefer you not to do so. + * to iPXE or https://ipxe.org, we prefer you not to do so. * * If you have an OEM-mandated branding requirement that cannot be * satisfied simply by defining PRODUCT_NAME and PRODUCT_SHORT_NAME, diff --git a/src/config/branding.h b/src/config/branding.h index 73f00af95..e503dff9a 100644 --- a/src/config/branding.h +++ b/src/config/branding.h @@ -26,7 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); */ #define PRODUCT_NAME "" #define PRODUCT_SHORT_NAME "iPXE" -#define PRODUCT_URI "http://ipxe.org" +#define PRODUCT_URI "https://ipxe.org" /* * Tag line @@ -44,15 +44,15 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * (e.g. "Permission denied") and a 32-bit error number. This number * is incorporated into an error URI such as * - * "No such file or directory (http://ipxe.org/2d0c613b)" + * "No such file or directory (https://ipxe.org/2d0c613b)" * * or * - * "Operation not supported (http://ipxe.org/3c092003)" + * "Operation not supported (https://ipxe.org/3c092003)" * * Users may browse to the URI within the error message, which is * provided by a database running on the iPXE web site - * (http://ipxe.org). This database provides details for all possible + * (https://ipxe.org). This database provides details for all possible * errors generated by iPXE, including: * * - the detailed error message (e.g. "Not an OCSP signing @@ -74,13 +74,13 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * * If you have a customer support team and would like your customers * to contact your support team for all problems, instead of using the - * existing support infrastructure provided by http://ipxe.org, then + * existing support infrastructure provided by https://ipxe.org, then * you may define a custom URI to be included within error messages. * * Note that the custom URI is a printf() format string which must * include a format specifier for the 32-bit error number. */ -#define PRODUCT_ERROR_URI "http://ipxe.org/%08x" +#define PRODUCT_ERROR_URI "https://ipxe.org/%08x" /* * Command help messages @@ -88,7 +88,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * iPXE command help messages include a URI constructed from the * command name, such as * - * "See http://ipxe.org/cmd/vcreate for further information" + * "See https://ipxe.org/cmd/vcreate for further information" * * The iPXE web site includes documentation for the commands provided * by the iPXE shell, including: @@ -113,7 +113,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * * If you want to provide your own documentation for all of the * commands provided by the iPXE shell, rather than using the existing - * support infrastructure provided by http://ipxe.org, then you may + * support infrastructure provided by https://ipxe.org, then you may * define a custom URI to be included within command help messages. * * Note that the custom URI is a printf() format string which must @@ -124,7 +124,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * iPXE project and prohibit the alteration or removal of any * references to "iPXE". ] */ -#define PRODUCT_COMMAND_URI "http://ipxe.org/cmd/%s" +#define PRODUCT_COMMAND_URI "https://ipxe.org/cmd/%s" /* * Setting help messages @@ -132,7 +132,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * iPXE setting help messages include a URI constructed from the * setting name, such as * - * "http://ipxe.org/cfg/initiator-iqn" + * "https://ipxe.org/cfg/initiator-iqn" * * The iPXE web site includes documentation for the settings used by * iPXE, including: @@ -156,7 +156,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * * If you want to provide your own documentation for all of the * settings used by iPXE, rather than using the existing support - * infrastructure provided by http://ipxe.org, then you may define a + * infrastructure provided by https://ipxe.org, then you may define a * custom URI to be included within setting help messages. * * Note that the custom URI is a printf() format string which must @@ -167,7 +167,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * iPXE project and prohibit the alteration or removal of any * references to "iPXE". ] */ -#define PRODUCT_SETTING_URI "http://ipxe.org/cfg/%s" +#define PRODUCT_SETTING_URI "https://ipxe.org/cfg/%s" #include diff --git a/src/include/ipxe/srp.h b/src/include/ipxe/srp.h index 3abb0995f..1f66a22b2 100644 --- a/src/include/ipxe/srp.h +++ b/src/include/ipxe/srp.h @@ -774,7 +774,7 @@ struct srp_aer_rsp { * The working draft specification for the SRP boot firmware table can * be found at * - * http://ipxe.org/wiki/srp/sbft + * https://ipxe.org/wiki/srp/sbft * ***************************************************************************** */ diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c index 62e90ecd0..24043ae69 100644 --- a/src/usr/autoboot.c +++ b/src/usr/autoboot.c @@ -579,8 +579,8 @@ int ipxe ( struct net_device *netdev ) { * defining the string PRODUCT_NAME in config/branding.h. * * While nothing in the GPL prevents you from removing all - * references to iPXE or http://ipxe.org, we prefer you not to - * do so. + * references to iPXE or https://ipxe.org, we prefer you not + * to do so. * */ printf ( NORMAL "\n\n" PRODUCT_NAME "\n" BOLD PRODUCT_SHORT_NAME " %s" diff --git a/src/util/niclist.pl b/src/util/niclist.pl index 2668a1c03..c35a3277e 100755 --- a/src/util/niclist.pl +++ b/src/util/niclist.pl @@ -565,7 +565,7 @@ EOM return join("\n", @output); } -# Output NIC list in DokuWiki format (for http://ipxe.org) +# Output NIC list in DokuWiki format (for https://ipxe.org) sub format_nic_list_dokuwiki { my ($nic_list, $column_names) = @_; my @output; -- cgit v1.2.3-55-g7522