summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* [tls] Fix wrong memset in function tls_clear_cipherStefan Weil2012-04-101-1/+1
| | | | | | | | | | sizeof(cipherspec) is obviously wrong in this context, because it will only zero the first 4 or 8 bytes (cipherspec is a pointer). This problem was reported by cppcheck. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Fix wrong setup in function aes_wrapStefan Weil2012-04-101-1/+1
| | | | | | | | | Use explicit size in memset because 8 bytes must be set always. This problem was reported by cppcheck. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Fix compilation on some versions of gccMichael Brown2012-04-101-4/+3Star
| | | | | | | | | Using __from_text16() and __from_data16() in inline asm constraints sometimes defeats gcc's ability to simplify expressions down to compile-time constants. Reported-by: Jason Kohles <jkohles@palantir.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [syslog] Add basic support for encrypted syslog via TLSMichael Brown2012-04-104-0/+282
| | | | | | | Encrypted syslog seems not yet to be standardised, but is supported by some existing syslog servers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [elf] Avoid attempting to load 64-bit ELF binariesMichael Brown2012-04-091-1/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Fix use-after-free in debug messagesMichael Brown2012-03-301-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Fix default selection when default is item 0Michael Brown2012-03-301-2/+2
| | | | | Reported-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Add support for emulating floppy disk drivesMichael Brown2012-03-303-56/+297
| | | | | Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [comboot] Remove COMBOOT image support by defaultMichael Brown2012-03-291-1/+0Star
| | | | | | | | | | | iPXE's support for COMBOOT images is now quite outdated; it has not kept up to date with changes in the COMBOOT API. The primary use for COMBOOT seems to be for menuing support. Now that we have native iPXE script-based menus, COMBOOT support can be gracefully retired (with immense thanks to Daniel Verkamp for having successfully implemented such an ambitious feature many years ago). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Add menu commandsMichael Brown2012-03-297-0/+312
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow iPXE scripts to create menus. For example: #!ipxe menu iSCSI boot demonstration item install Install Fedora to ${root-path} item --default boot Boot from ${root-path} item shell Enter iPXE shell item exit Exit to BIOS choose label && goto ${label} :boot sanboot ${root-path} :install sanhook ${root-path} chain http://${next-server}/fedora.ipxe :shell shell :exit Inspired-by: Robin Smidsrød <robin@smidsrod.no> Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Add menu user interfaceMichael Brown2012-03-293-0/+362
| | | | | | Inspired-by: Robin Smidsrød <robin@smidsrod.no> Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [menu] Add the abstract concept of a menuMichael Brown2012-03-292-0/+224
| | | | | | Inspired-by: Robin Smidsrød <robin@smidsrod.no> Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Recognise Page Up and Page Down keysMichael Brown2012-03-291-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Allow "prompt" command to accept character literals for --keyMichael Brown2012-03-293-2/+21
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [readline] Accept Ctrl-U for "delete to start of line"Robin Smidsrød2012-03-281-0/+16
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [http] Disambiguate the various error causesMichael Brown2012-03-271-13/+45
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Add "no_latin1" keymapMichael Brown2012-03-271-0/+34
| | | | | | | | The "no" keymap is for a Dvorak keyboard. Reported-by: Robin Smidsrød <robin@smidsrod.no> Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Ignore unexpected keysyms when generating keyboard mapsMichael Brown2012-03-271-2/+4
| | | | | | | | I am unable to find any definitive documentation on how Linux keyboard symbols work. In the absence of any documentation, I'm going to assume that unexpected keysyms are harmless and should be ignored. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add an explicit "RSA signature incorrect" error messageMichael Brown2012-03-271-1/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Add LOG_ALL as a synonym for LOG_DEBUGMichael Brown2012-03-271-0/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Log image executionsMichael Brown2012-03-271-0/+13
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Remove "log message" usage from interactive console defaultsMichael Brown2012-03-275-5/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [downloader] Use a more meaningful error message when out of memoryMichael Brown2012-03-271-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [downloader] Abort download immediately if buffer resizing failsMichael Brown2012-03-271-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [umalloc] Unhide umalloc()ed memory region when there are no allocationsMichael Brown2012-03-271-1/+2
| | | | | | | | At present, we always hide an extra sizeof(struct external_memory), to account for the header on the lowest allocated block. This header ceases to exist when there are no allocated blocks remaining. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [umalloc] Fail allocations when we run out of external memoryMichael Brown2012-03-271-7/+22
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Disambiguate all CMS errorsMichael Brown2012-03-271-5/+26
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Log results of image signature checksMichael Brown2012-03-271-0/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [downloader] Log final status of all downloadsMichael Brown2012-03-261-0/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [syslog] Pass internal syslog() priority through to syslog consoleMichael Brown2012-03-264-14/+53
| | | | | | | 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>
* [console] Do not share ANSI escape context between lineconsole usersMichael Brown2012-03-264-11/+20
| | | | | | | | 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>
* [console] Add "log message" console usage and an internal syslog() callMichael Brown2012-03-265-3/+156
| | | | | | | | | | | | | | | Provide an internal syslog() function (unrelated to the syslog console) which can be used to create log messages with specified priorities. The build-time constant LOG_LEVEL can be used to select the minimum required priority for log messages. Any messages that do not have a sufficient priority will be ignored (and will be optimised away at compile-time). The default LOG_LEVEL is LOG_NONE. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Exclude text-based UI output from logfile-based consolesMichael Brown2012-03-264-5/+21
| | | | | | | | 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>
* [console] Allow usage to be defined independently for each consoleMichael Brown2012-03-2611-31/+155
| | | | | | | | | | | | | | | | | | | | | 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>
* [console] Remove unused "btext" consoleMichael Brown2012-03-264-5105/+0Star
| | | | | | The "btext" console has been disabled by a "#if 0" since 2007. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Move putchar() and getchar() declarations to stdio.hMichael Brown2012-03-2613-13/+6Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Add the "imgtrust" and "imgverify" commandsMichael Brown2012-03-256-0/+275
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify image management commands and internal APIMichael Brown2012-03-2512-370/+290Star
| | | | | | | | | | | | | | | | | | | | | | Remove the name, cmdline, and action parameters from imgdownload() and imgdownload_string(). These functions now simply download and return an image. Add the function imgacquire(), which will interpret a "name or URI string" parameter and return either an existing image or a newly downloaded image. Use imgacquire() to merge similar image-management commands that currently differ only by whether they take the name of an existing image or the URI of a new image to download. For example, "chain" and "imgexec" can now be merged. Extend imgstat and imgfree commands to take an optional list of images. Remove the arbitrary restriction on the length of image names. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix compilation under CygwinMichael Brown2012-03-232-2/+2
| | | | | Originally-fixed-by: Steve Goodrich <steve.goodrich@se-eng.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Add concept of trusted imagesMichael Brown2012-03-223-0/+70
| | | | | | | | | | | | | | | | Trusted images may always be executed. Untrusted images may be executed only if the current image trust requirement allows untrusted images. Images can be marked as trusted using image_trust(), and marked as untrusted using image_untrust(). The current image trust requirement can be changed using image_set_trust(). It is possible to make the change permanent, in which case any future attempts to change the image trust requirement will fail. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Set character attributes only when necessaryMichael Brown2012-03-221-0/+8
| | | | | | | | | | | | | | | | | | | There is no INT 10 call for "display character with attribute, advancing the cursor and scrolling the screen as necessary". We therefore make two INT 10 calls: INT 10,09 to write the character with its attribute at the current cursor position, and then INT 10,0e to (re)write the character (leaving the attribute unchanged), advance the cursor position and scroll as necessary. This confuses the serial-over-LAN console redirection feature provided by some BIOSes. Fix by performing the INT10,09 only when necessary to change the existing attribute. Reported-by: Itay Gazit <itaygazit@gmail.com> Tested-by: Itay Gazit <itaygazit@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add CMS self-testsMichael Brown2012-03-222-0/+1431
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add support for Cryptographic Message Syntax (PKCS #7)Michael Brown2012-03-224-0/+639
| | | | | | | | | | | | The Cryptographic Message Syntax (PKCS#7) provides a format for encapsulating digital signatures of arbitrary binary blobs. A signature can be generated using openssl cms -sign -in <file to sign> -binary -noattr \ -signer <signer>.crt -inkey <signer>.key -certfile <CA>.crt \ -outform DER -out <signature> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Parse X.509 extended key usage extensionMichael Brown2012-03-223-0/+124
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Differentiate "untrusted root" and "incomplete chain" error casesMichael Brown2012-03-222-6/+18
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Shrink raw certificate data to fit certificateMichael Brown2012-03-221-0/+1
| | | | | | | The certificate may be part of an ASN.1-encoded certificate chain, and so may not be the only object contained within the ASN.1 cursor. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Avoid an error when asn1_shrink() is already at end of objectMichael Brown2012-03-221-7/+12
| | | | | | | asn1_skip() will return an error on reaching the end of an object, and so should not be used as the basis for asn1_shrink(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add previous certificate in chain as a parameter to parse_next()Michael Brown2012-03-224-6/+16
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Parse X.509 certificate serial numberMichael Brown2012-03-222-2/+37
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Define ASN.1 OID-identified algorithms for all supported digestsMichael Brown2012-03-223-0/+33
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>