[prefix] Eliminate uninitialised variable

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[ath9k] Fix compilation on older gcc versions

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[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>
[tls] Use const to mark incoming data being processed

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[forcedeth] Use standard random() function

It seems unlikely that a network card driver requires
cryptographically secure random numbers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[802.11] Use rbg_generate() for secure random numbers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[rng] Remove obsolete (and unfinished) get_random_bytes() function

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[crypto] Add ASN.1 functions for X.509 certificate parsing

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[crypto] Add big-integer library for RSA calculations

RSA requires modular exponentiation using arbitrarily large integers.
Given the sizes of the modulus and exponent, all required calculations
can be done without any further dynamic storage allocation.  The x86
architecture allows for efficient large integer support via inline
assembly using the instructions that take advantage of the carry flag
(e.g. "adcl", "rcrl").

This implemention is approximately 80% smaller than the (more generic)
AXTLS implementation.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[test] Add big integer self-tests

These test vectors are generated using Perl's Math::BigInt.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[eepro100] Add PCI ID 8086:10fe

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[crypto] Use real prototypes for AXTLS' AES_encrypt() and AES_decrypt()

Avoid a compiler warning on some versions of gcc by using real
function prototypes.

Reported-by: Rob Shelley <Rob@cirris.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
[myri10ge] Fix compilation error in myri10ge_command() with gcc 4.7

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[libc] Move VA_ARG_COUNT() macro to stdarg.h

Make the non-standard but extremely useful macro VA_ARG_COUNT()
available outside of dhcp.h.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[rng] Fix build error when assertions are enabled

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[test] Run self-tests as an embedded image

Allow iPXE to exit after running self-tests, rather than locking the
machine.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[crypto] Add more ASN.1 functions for X.509 certificate parsing

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[crypto] Add abstraction for a public-key algorithm

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[crypto] Add native RSA algorithm

Add an implementation of RSA that uses the iPXE big-integer support.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
[test] Add self-tests for RSA

Add self-tests for the RSA algorithm using test vectors generated with
the openssl tools.

Signed-off-by: Michael Brown <mcb30@ipxe.org>