david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

810 Commits

Author SHA1 Message Date
Michael Brown 3ff7927d2f [syslog] Pass internal syslog() priority through to syslog console
Use a private ANSI escape sequence to convey the priority of an
internal syslog() message through to the syslog server.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-26 21:58:58 +01:00
Michael Brown c2875ae329 [console] Do not share ANSI escape context between lineconsole users
An ANSI escape sequence context cannot be shared between multiple
users.  Make the ANSI escape sequence context part of the line console
definition and provide individual contexts for each user.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-26 21:58:50 +01:00
Michael Brown 64d17dbd50 [console] Exclude text-based UI output from logfile-based consoles
The output from text-based user interfaces such as the "config"
command is not generally meaningful for logfile-based consoles such as
syslog and vmconsole.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-26 19:02:30 +01:00
Michael Brown e024cd39a8 [console] Allow usage to be defined independently for each console
Add the concept of a "console usage", such as "standard output" or
"debug messages".  Allow usages to be associated with each console
independently.  For example, to send debugging output via the serial
port, while preventing it from appearing on the local console:

  #define CONSOLE_SERIAL CONSOLE_USAGE_ALL
  #define CONSOLE_PCBIOS ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_DEBUG )

If no usages are explicitly specified, then a default set of usages
will be applied.  For example:

  #define CONSOLE_SERIAL

will have the same affect as

  #define CONSOLE_SERIAL CONSOLE_USAGE_ALL

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-26 17:40:01 +01:00
Michael Brown f2af64aba5 [crypto] Differentiate "untrusted root" and "incomplete chain" error cases
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-22 11:41:22 +00:00
Michael Brown 2d9d0adc4e [crypto] Add previous certificate in chain as a parameter to parse_next()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-22 01:34:40 +00:00
Michael Brown cf78afa5c5 [tls] Support sending a client certificate
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-20 20:42:51 +00:00
Michael Brown 7869f71ae7 [tls] Treat handshake digest algorithm as a session parameter
Simplify code by recording the active handshake digest algorithm as a
session parameter.  (Note that we must still accumulate digests for
all supported algorithms, since we don't know which digest will
eventually be used until we receive the Server Hello.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-20 17:10:39 +00:00
Michael Brown a156c15746 [tls] Use hybrid MD5+SHA1 algorithm
TLSv1.1 and earlier use a hybrid of MD5 and SHA-1 to generate digests
over the handshake messages.  Formalise this as a separate digest
algorithm "md5+sha1".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-20 16:57:16 +00:00
Michael Brown 8583c323a2 [tls] Check certificate validity period against current date and time
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-19 23:14:17 +00:00
Michael Brown 5da712385e [tls] Include current time within the client random bytes
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-19 23:07:13 +00:00
Michael Brown f3a791c6de [tls] Validate server certificate
Validate the server certificate against the trusted root certificate
store.  The server must provide a complete certificate chain, up to
and including the trusted root certificate that is embedded into iPXE.

Note that the date and time are not yet validated.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-19 00:26:19 +00:00
Michael Brown 4d3b5473f8 [tls] Add full X.509 certificate parsing
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-19 00:22:22 +00:00
Michael Brown dc87161c30 [tls] Use iPXE native RSA algorithm
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-18 14:44:53 +00:00
Michael Brown 554627c960 [802.11] Use rbg_generate() for secure random numbers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-13 15:58:04 +00:00
Michael Brown b63bcd73a0 [tls] Use const to mark incoming data being processed
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-13 15:57:34 +00:00
Michael Brown 1c29b4d979 [crypto] Upgrade AES and RSA code to upstream axTLS version 1.4.5
All axTLS files are now vanilla versions of the upstream axTLS files,
with one minor exception: the unused "ctx" parameter of
bi_int_divide() has been marked with "__unused" to avoid a compilation
error.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-09 17:14:39 +00:00
Michael Brown c8f52cccfb [tls] Formalise the definition of a TLS cipher suite
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-05 23:13:52 +00:00
Michael Brown 6069b09bfc [tls] Support (and prefer) SHA-256 variants of existing cipher suites
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-05 15:36:38 +00:00
Michael Brown 015c936791 [tls] Support TLS version 1.2
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-05 15:28:39 +00:00
Michael Brown cdb4802ff1 [802.11] Avoid using struct md5_ctx directly
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-05 10:18:16 +00:00
Michael Brown 4fde501e39 [802.11] Add missing #include <byteswap.h>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 15:14:16 +00:00
Michael Brown 281f9aa7a6 [tls] Send empty Certificate record if requested by server
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-03 22:47:16 +00:00
Michael Brown a42f6cab14 [tls] Verify the contents of the Finished record
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-03 22:29:20 +00:00
Michael Brown 56a7981d58 [tls] Allow transmitted records to be scheduled independently
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-03 22:15:25 +00:00
Michael Brown b7f8d1bbfd [tls] Add support for Server Name Indication (SNI)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-03 20:15:21 +00:00
Michael Brown d9ce3bfe4c [tls] Support TLS version 1.1
Advertise support for TLS version 1.1, and be prepared to downgrade to
TLS version 1.0.  Tested against Apache with mod_gnutls, using the
GnuTLSPriorities directive to force specific protocol versions.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-03 16:19:12 +00:00
Michael Brown d620606d3e [arp] Maintain an ARP transmission queue
Allow packet transmission to be deferred pending successful ARP
resolution.  This avoids the time spent waiting for a higher-level
protocol (e.g. TCP or TFTP) to attempt retransmission.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-02 23:46:29 +00:00
Michael Brown 6324bd9389 [undi] Allow underlying PXE stack to construct link-layer header
Some PXE stacks (observed with a QLogic 8242) will always try to
prepend a link-layer header, even if the caller uses P_UNKNOWN to
indicate that the link-layer header has already been filled in.  This
results in an invalid packet being transmitted.

Work around these faulty PXE stacks where possible by stripping the
existing link-layer header and allowing the PXE stack to (re)construct
the link-layer header itself.

Originally-fixed-by: Buck Huppmann <buckh@pobox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-02 18:02:03 +00:00
Michael Brown 1d293776ea [iscsi] Send any padding inline with the data segment
Some iSCSI targets respond to a PDU before receiving the padding
bytes.  If the target responds quickly enough, this can cause iPXE to
start processing a new TX PDU before the padding bytes have been sent,
which results in a protocol violation.

Fix by always transmitting the padding bytes along with the data
segment.

Originally-fixed-by: Shyam Iyer <shyam_iyer@dell.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-01 16:33:05 +00:00
Jason Lunz cb10137e19 [http] Recognise status code 303 as valid
As RFC 2616 10.3.4 explains, a 303 status is the proper HTTP 1.1
behavior for what most HTTP 1.0 clients did with code 302.

Signed-off-by: Jason Lunz <lunz@acm.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-01 16:16:53 +00:00
Michael Brown 851b93fbc3 [syslog] Separate out generic line-based console functionality
Abstract out the generic line-handling portions of the syslog
putchar() routine, to allow use by other console types.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-28 23:10:01 +00:00
Michael Brown c72b8969e2 [syslog] Disable console when no syslog server is defined
Explicitly disable the syslog console when no syslog server is
defined, rather than (ab)using the socket family address as an
equivalent console-enabled flag.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-28 23:10:01 +00:00
Michael Brown 99de239867 [http] Allow for HTTPS-only builds
Separate out the core HTTP functionality (which is shared by both HTTP
and HTTPS) from the provision of the "http://" URI opener.  This
allows for builds that support only "https://" URIs.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-28 14:54:32 +00:00
Michael Brown 75090f2abf [tls] Use ANS X9.82 Approved RBG as source of random data for TLS
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:54 +00:00
Michael Brown a8756182c3 [802.11] Add missing #include <string.h>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:37 +00:00
Michael Brown bb36f3d7dc [udp] Propagate transmission errors to UDP interface users
Suggested-by: Simon Rowe <simon.rowe@eu.citrix.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-20 19:29:49 +00:00
Michael Brown 187cd80106 [dns] Allow trailing dots in DNS names
Reported-by: Christian Hesse <list@eworm.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-01-10 23:25:00 +00:00
Michael Brown 8926c233f6 [dhcp] Add PXE-mandated DHCP options [128,135] to parameter request list
The PXE specification requires us to request DHCP options 128 to 135
inclusive, although these have no defined purpose.

Suggested-by: Ralf Buettner <rab@bootix.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-06 13:54:45 +00:00
Michael Brown bd718b2110 [iscsi] Fail immediately if target rejects any of our parameters
Some iSCSI targets (observed with stgt) can be configured to reject
connections that do not use header or data digests, and will respond
with "HeaderDigest=Reject" and/or "DataDigest=Reject", while still
allowing the connection to proceed to the full feature phase.

According to a strict reading of RFC3720, we are perfectly safe to
ignore these "Reject" messages: upon such a rejection "the negotiated
key is left at its current value (or default if no value was set)".
Since the default value for both HeaderDigest and DataDigest is
"None", then the only viable conclusion to be drawn is that the value
resulting from "Reject" is still "None".

Unfortunately, stgt doesn't seem to agree with this interpretation of
events, causing us to eventually report an unhelpful "connection timed
out" message to the user when we don't get any response to our first
PDU in full feature phase.

Fix by detecting any rejected parameters and immediately reporting an
error, which at least gives the user some insight as to what the real
problem may be.

Reported-by: Michal Suchanek <hramrach@centrum.cz>
Tested-by: Michal Suchanek <hramrach@centrum.cz>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-05 20:39:07 +00:00
Michael Brown 18178b087f [infiniband] Reset port state after closing device
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-15 03:59:10 +00:00
Michael Brown 1e7fbc5bf3 [infiniband] Open device prior to creating SMI and GSI queue pairs
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-15 03:59:10 +00:00
Michael Brown 774ea3d263 [infiniband] Poll event queues only for devices that are open
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-15 03:59:09 +00:00
Michael Brown 4f4369064b [netdevice] Allow driver to preinitialise the link-layer address
Drivers are currently expected to initialise only the hardware
address, with the link-layer protocol code taking care of converting
this into a valid link-layer address.  Some drivers (e.g. undinet) can
legitimately determine both the hardware and link-layer addresses,
which may differ.

Allow for this situation by checking to see if the link-layer address
is empty before initialising it from the hardware address.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-28 22:32:33 +01:00
Michael Brown 38b205d0a4 [list] Tidy up naming convention for list_contains() and friends
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-14 14:33:31 +01:00
Michael Brown 12767d2202 [dhcp] Use a random DHCP transaction identifier (xid)
iPXE currently uses the last four bytes of the MAC address as the DHCP
transaction identifier.  Reduce the probability of collisions by
generating a random transaction identifier.

Originally-implemented-by: Amos Kong <akong@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-09-19 17:35:42 +01:00
Michael Brown 469bd11f39 [tcp] Allow sufficient headroom for TCP headers
TCP currently neglects to allow sufficient space for its own headers
when allocating I/O buffers.  This problem is masked by the fact that
the maximum link-layer header size (802.11) is substantially larger
than the common Ethernet link-layer header.

Fix by allowing sufficient space for any TCP headers, as well as the
network-layer and link-layer headers.

Reported-by: Scott K Logan <logans@cottsay.net>
Debugged-by: Scott K Logan <logans@cottsay.net>
Tested-by: Scott K Logan <logans@cottsay.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-09-19 15:52:54 +01:00
Michael Brown 149b502306 [ipv4] Improve debugging
Use autocolourisation to improve legibility, and move per-packet
messages to DBG2().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-07-16 01:49:47 +01:00
Michael Brown 13186b64b6 [ipv4] Fix fragment reassembly
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-07-16 01:49:47 +01:00
Michael Brown 17f09dfe03 [retry] Fix potential use-after-free in timer_expired()
timer->refcnt is allowed to be NULL, in which case the timer's
expired() method may end up freeing the timer object.

Discovered using valgrind.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-07-16 01:49:47 +01:00