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

206 Commits

Author SHA1 Message Date
Michael Brown cb29cd4298 [crypto] Report meaningful error when certificate chain validation fails
If a certificate chain contains no certificate which can be validated
as a standalone certificate (i.e. contains no trusted root
certificates or previously-validated certificates) then iPXE will
currently return a fixed error EACCES_UNTRUSTED.  This masks the
actual errors obtained when attempting to validate each certificate as
a standalone certificate, and so makes troubleshooting difficult for
the end user.

Fix by instead returning the error obtained when attempting to
validate the final certificate in the chain as a standalone
certificate.  This error is most likely (though not guaranteed) to
represent the "real" problem.

Reported-by: Sven Dreyer <sven@dreyer-net.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-05-10 10:03:56 +01:00
Michael Brown e42bc3aa37 [libc] Use __einfo() tuple as first argument to EUNIQ()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-04-19 00:45:13 +01:00
Michael Brown 09d45ffd79 [crypto] Allow in-place CBC decryption
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-09-27 01:54:55 +01:00
Michael Brown c3b4860ce3 [legal] Update FSF mailing address in GPL licence texts
Suggested-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-07-20 19:55:45 +01:00
Michael Brown 024247317d [arp] Try to avoid discarding ARP cache entries
Discarding the active ARP cache entry in the middle of a download will
substantially disrupt the TCP stream.  Try to minimise any such
disruption by treating ARP cache entries as expensive, and discarding
them only when nothing else is available to discard.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-07-09 10:08:38 +01:00
Michael Brown 4010890a39 [crypto] Allow an error margin on X.509 certificate validity periods
iPXE has no concept of the local time zone, mainly because there is no
viable way to obtain time zone information in the absence of local
state.  This causes potential problems with newly-issued certificates
and certificates that are about to expire.

Avoid such problems by allowing an error margin of around 12 hours on
certificate validity periods, similar to the error margin already
allowed for OCSP response timestamps.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-06-20 12:15:42 +01:00
Michael Brown 4fa1a2b4fe [crypto] Rename KEY= to PRIVKEY= and "key" to "privkey"
The setting name "key" conflicts with the setting name "key" already
in use by the 802.11 code.  Resolve the conflict by renaming the newer
setting to "privkey".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-22 01:13:43 +01:00
Michael Brown 7fa1f41f7d [crypto] Require OCSP check if certificate provides an OCSP URI
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-22 00:53:44 +01:00
Michael Brown 944e023def [crypto] Construct OCSP check URI
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-21 23:21:38 +01:00
Michael Brown 57de8b6272 [crypto] Fix margin of error for OCSP checks
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-21 23:21:37 +01:00
Michael Brown b278094902 [crypto] Return a NULL OCSP check if construction fails
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-21 23:21:37 +01:00
Michael Brown c923d57663 [crypto] Return a NULL X.509 certificate if construction fails
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-21 23:21:36 +01:00
Michael Brown f20c3742e7 [crypto] Accept UTCTime/GeneralizedTime with no "seconds" field
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-21 23:21:36 +01:00
Michael Brown 39ac285a8a [crypto] Add framework for OCSP
Add support for constructing OCSP queries and parsing OCSP responses.
(There is no support yet for actually issuing an OCSP query via an
HTTP POST.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-15 13:24:23 +01:00
Michael Brown deac4ea1ba [crypto] Add functions for constructing ASN.1 objects
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-14 18:09:43 +01:00
Michael Brown e01af7367d [crypto] Parse OCSPSigning key purpose, if present
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-14 18:09:40 +01:00
Michael Brown 4aad46ac70 [crypto] Generalise x509_parse_bit_string() to asn1_bit_string()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-14 11:02:38 +01:00
Michael Brown 7deb610881 [crypto] Generalise asn1_{digest,pubkey,signature}_algorithm()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-14 00:20:28 +01:00
Michael Brown 88c09b36cf [crypto] Generalise x509_parse_time() to asn1_generalized_time()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-14 00:20:25 +01:00
Michael Brown e5858c1938 [crypto] Parse X.509 raw public key bit string
OCSP requires direct access to the bit string portion of the subject
public key information.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-14 00:14:27 +01:00
Michael Brown 0e4ee60a75 [crypto] Reduce standard debugging output
X.509 certificate processing currently produces an overwhelming amount
of debugging information.  Move some of this from DBGLVL_LOG to
DBGLVL_EXTRA, to make the output more manageable.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-09 10:01:14 +01:00
Michael Brown 1a5f025ad8 [crypto] Add x509_auto_append()
CMS includes an unordered certificate set, from which certificates
must be extracted in order by matching up issuers with subjects.  We
will use the same functionality as part of the automatic download of
cross-signing certificates.  Generalise cms_find_subject() to
x509_find_subject(), and create x509_auto_append().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-08 12:49:01 +01:00
Michael Brown 99c798d87a [crypto] Add x509_append_raw()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-08 12:49:01 +01:00
Michael Brown 6c8fcd4bb3 [crypto] Check that common name contains no NUL characters
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-08 12:49:01 +01:00
Michael Brown 0ad8b601dd [crypto] Allow for X.509 certificates with no common name
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-08 12:49:01 +01:00
Michael Brown 557f467bab [crypto] Allow certificate chains to be long-lived data structures
At present, certificate chain validation is treated as an
instantaneous process that can be carried out using only data that is
already in memory.  This model does not allow for validation to
include non-instantaneous steps, such as downloading a cross-signing
certificate, or determining certificate revocation status via OCSP.

Redesign the internal representation of certificate chains to allow
chains to outlive the scope of the original source of certificates
(such as a TLS Certificate record).

Allow for certificates to be cached, so that each certificate needs to
be validated only once.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-04 17:54:31 +01:00
Michael Brown 793b8b0893 [crypto] Fix memory leak in cms_verify_digest()
Detected using Valgrind.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-04 15:32:20 +01:00
Michael Brown 601cb3610f [crypto] Parse OCSP responder URI from X.509 certificate
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-05-04 15:15:34 +01:00
Michael Brown bd16deaa87 [crypto] Do not allow build-time cryptography settings to be overridden
If a root certificate has been explicitly specified at build time
using TRUST=/path/to/cert then do not allow this to be overridden even
from a trustworthy settings source (such as VMware GuestInfo).

Similarly, if a client certificate (and private key) has been
explicitly specified at build time, then do not allow it to be
overridden at runtime.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-24 16:28:15 +01:00
Michael Brown 63d9cc28b9 [crypto] Allow client certificate to be changed without a rebuild
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-24 13:17:29 +01:00
Michael Brown 02f1f3066d [crypto] Allow trusted root certificate to be changed without a rebuild
Changing the trusted root certificate currently requires a rebuild of
the iPXE binary, which may be inconvenient or impractical.

Allow the list of trusted root certificate fingerprints to be
overridden using the "trust" setting, but only at the point of iPXE
initialisation.  This prevents untrusted sources of settings
(e.g. DHCP) from subverting the chain of trust, while allowing
trustworthy sources to change the trusted root certificate without
requiring a rebuild.

The basic idea is that if you are able to manipulate a trustworthy
source of settings (e.g. VMware GuestInfo or non-volatile stored
options), then you would be able to replace the iPXE binary anyway,
and so no security is lost by allowing such sources to override the
list of trusted root certificates.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-04-19 16:11:20 +01:00
Stefan Weil ede37e493d [crypto] Fix wrong setup in function aes_wrap
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>
2012-04-10 13:14:15 +01:00
Michael Brown ed64732b73 [crypto] Add an explicit "RSA signature incorrect" error message
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-27 14:58:45 +01:00
Michael Brown 0f0a94f2fa [crypto] Disambiguate all CMS errors
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-26 23:34:49 +01:00
Michael Brown bdb69d587e [crypto] Add support for Cryptographic Message Syntax (PKCS #7)
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>
2012-03-22 11:41:23 +00:00
Michael Brown fe6e741c62 [crypto] Parse X.509 extended key usage extension
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-22 11:41:22 +00: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 5c66395939 [crypto] Shrink raw certificate data to fit certificate
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>
2012-03-22 11:41:21 +00:00
Michael Brown 2cd24473b8 [crypto] Avoid an error when asn1_shrink() is already at end of object
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>
2012-03-22 02:28:49 +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 c285378388 [crypto] Parse X.509 certificate serial number
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-22 00:31:22 +00:00
Michael Brown d56499ab18 [crypto] Define ASN.1 OID-identified algorithms for all supported digests
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-22 00:31:22 +00:00
Michael Brown 38b7e43f7d [crypto] Generalise X.509 OID-identified algorithm to asn1.c
The concept of an OID-identified algorithm as defined in X.509 is used
in some other standards (e.g. PKCS#7).  Generalise this functionality
and provide it as part of the ASN.1 core.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-22 00:31:22 +00:00
Michael Brown b1316ef276 [crypto] Validate path length constraint in certificate chain
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-21 19:19:28 +00:00
Michael Brown c76afb3605 [crypto] Use standard bit-rotation functions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-21 16:27:12 +00:00
Michael Brown 8685280cbd [build] Allow a client certificate to be specified at build time
Allow a client certificate and corresponding private key to be
specified at build time using the syntax

  make CERT=/path/to/certificate KEY=/path/to/key

The build process uses openssl to convert the files into DER format,
and includes them within the client certificate store in
clientcert.c.  The build process will prompt for the private key
password if applicable.

Note that the private key is stored unencrypted, and so the resulting
iPXE binary (and the temporary files created during the build process)
should be treated as being equivalent to an unencrypted private key
file.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-20 20:39:11 +00:00
Michael Brown 05c13716f9 [crypto] Use linker tables for RSA digestInfo prefixes
Allow external code to specify RSA digestInfo prefixes for additional
digest algorithms.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-20 17:10:39 +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 0610bcb1d2 [tls] Parse X.509 validity times into seconds since the Epoch
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-19 23:07:15 +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 d6979e0d55 [rsa] Actually check the unused-bits byte in the public key bit string
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-18 20:46:38 +00:00
Michael Brown 3ec773cd2b [crypto] Force caller to provide temporary storage for modular calculations
bigint_mod_multiply() and bigint_mod_exp() require a fixed amount of
temporary storage for intermediate results.  (The amount of temporary
storage required depends upon the size of the integers involved.)

When performing calculations for 4096-bit RSA the amount of temporary
storage space required will exceed 2.5kB, which is too much to
allocate on the stack.  Avoid this problem by forcing the caller to
allocate temporary storage.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-18 20:22:43 +00:00
Michael Brown 196f0bb081 [rng] Allow entropy_enable() to return an error
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-18 17:05:37 +00:00
Michael Brown 66f200bdac [crypto] Remove obsolete AXTLS RSA algorithm
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-18 14:47:16 +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 299dedcff0 [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>
2012-03-18 13:36:07 +00:00
Michael Brown c00eb6e190 [crypto] Add abstraction for a public-key algorithm
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-18 13:35:32 +00:00
Michael Brown e20550fddf [crypto] Add more ASN.1 functions for X.509 certificate parsing
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-18 13:34:47 +00:00
Michael Brown b0a1ad9242 [rng] Fix build error when assertions are enabled
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-18 12:26:33 +00:00
Michael Brown 37cb7c7498 [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>
2012-03-14 00:12:02 +00:00
Michael Brown 071184a6e4 [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>
2012-03-13 23:27:30 +00:00
Michael Brown f229162749 [crypto] Add ASN.1 functions for X.509 certificate parsing
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-13 16:30:17 +00:00
Michael Brown ffb6d6be6d [rng] Remove obsolete (and unfinished) get_random_bytes() function
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-13 15:58:04 +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 b9d9c3f1d5 [rng] Allow HMAC_DRBG to use multiple underlying hash algorithms
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-06 13:12:30 +00:00
Michael Brown fb6a33360f [rng] Allow hash_df() to accept multiple underlying hash algorithms
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-05 23:23:45 +00:00
Michael Brown fba2310562 [crypto] Replace MD5 implementation
Replace MD5 implementation with one which is around 20% smaller.  This
implementation has been verified using the existing MD5 self-tests.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-05 10:25:58 +00:00
Michael Brown 657ab17338 [crypto] Add SHA-256 algorithm
This implementation has been verified using the NIST SHA-256 test vectors.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-05 00:18:49 +00:00
Michael Brown 76f5939736 [crypto] Replace SHA-1 implementation
Replace SHA-1 implementation from AXTLS with a dedicated iPXE
implementation which is around 40% smaller.  This implementation has
been verified using the existing SHA-1 self-tests (including the NIST
SHA-1 test vectors).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 17:42:29 +00:00
Michael Brown 4100edf9d7 [802.11] Eliminate use of AXTLS-specific SHA1_SIZE constant
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 15:29:24 +00:00
Michael Brown c5c1ae42e6 [rng] Add missing #include <assert.h>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 15:14:20 +00:00
Michael Brown 5a80c11062 [crypto] Use ANS X9.82 Approved get_random_nz() for RSA
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:43:03 +00:00
Michael Brown 4fb60435c9 [rng] Add get_random_nz() function required by RSA algorithm
RSA requires the generation of random non-zero bytes (i.e. a sequence
of random numbers in the range [0x01,0xff]).  ANS X9.82 provides
various Approved methods for converting random bits into random
numbers.  The simplest such method is the Simple Discard Method.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:54 +00:00
Michael Brown 4e0effc6ad [rng] Add ANS X9.82 RBG wrapper functions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:46 +00:00
Michael Brown c6b0b3424b [rng] Add ANS X9.82 mandatory start-up tests
ANS X9.82 specifies that the start-up tests shall consist of at least
one full cycle of the continuous tests.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:45 +00:00
Michael Brown a3b116cea1 [rng] Add ANS X9.82 mandatory continuous tests
ANS X9.82 specifies two mandatory continuous tests to be performed
upon the noise source.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:45 +00:00
Michael Brown 073f41085f [rng] Add ANS X9.82 Approved Source of Entropy Input
ANS X9.82 specifies several Approved Sources of Entropy Input (SEI).
One such SEI uses an entropy source as the Source of Entropy Input,
condensing each entropy source output after each GetEntropy call.
This can be implemented relatively cheaply in iPXE and avoids the need
to allocate potentially very large buffers.

(Note that the terms "entropy source" and "Source of Entropy Input"
are not synonyms within the context of ANS X9.82.)

Use the iPXE API mechanism to allow entropy sources to be selected at
compilation time.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:38 +00:00
Michael Brown c2668b61ea [rng] Record validity within DRBG state
Treat an empty (zeroed) DRBG as invalid.  This ensures that a DRBG
that has not yet been instantiated (or that has been uninstantiated)
will refuse to attempt to generate random bits.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:37 +00:00
Michael Brown a99d5d5aca [rng] Add missing #include <string.h>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:37 +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 eec068253f [rng] Add ANS X9.82 Approved Hash_df derivation function
ANS X9.82 specifies several Approved derivation functions for use in
distributing entropy throughout a buffer.  One such derivation
function is Hash_df, which can be implemented using the existing iPXE
SHA-1 functionality.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-19 14:37:13 +00:00
Michael Brown 3a2bda7c7c [rng] Add ANS X9.82 Approved DRBG mechanism
ANS X9.82 specifies that an Approved DRBG must consist of an Approved
algorithm wrapped inside an envelope which handles entropy gathering,
prediction resistance, automatic reseeding and other housekeeping
tasks.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-01-23 15:08:21 +00:00
Michael Brown fcc35bf487 [rng] Add dummy entropy source
Cryptographic random number generation requires an entropy source,
which is used as the input to a Deterministic Random Bit Generator
(DRBG).

iPXE does not currently have a suitable entropy source.  Provide a
dummy source to allow the DRBG code to be implemented.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-01-23 15:07:46 +00:00
Michael Brown 5c2d6fa399 [rng] Add ANS X9.82 Approved HMAC_DRBG algorithm
ANS X9.82 specifies several Approved algorithms for use in a
Deterministic Random Bit Generator (DRBG).  One such algorithm is
HMAC_DRBG, which can be implemented using the existing iPXE SHA-1 and
HMAC functionality.  This algorithm provides a maximum security
strength of 128 bits.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-01-23 15:03:43 +00:00
Michael Brown 1691cf50bc [tls] Accept certificates without a version number
The version field of an X.509 certificate appears to be optional.

Reported-by: Sebastiano Manusia <Sebastiano.Manusia@chuv.ch>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-08-12 23:51:44 +01:00
Shao Miller 3b51710156 [legal] Add FILE_LICENCE macro to some GPL-v2-or-later files
Changes were made to files where the licence text within the files
themselves confirms that the files are GPL version 2 or later.

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-12-03 23:38:15 +00:00
Michael Brown 8406115834 [build] Rename gPXE to iPXE
Access to the gpxe.org and etherboot.org domains and associated
resources has been revoked by the registrant of the domain.  Work
around this problem by renaming project from gPXE to iPXE, and
updating URLs to match.

Also update README, LOG and COPYRIGHTS to remove obsolete information.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-04-19 23:43:39 +01:00
Joshua Oreman 8d08da3a99 [crypto] Add a placeholder for a proper random number generator
Currently it just calls random().

Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-01-05 09:07:33 -05:00
Joshua Oreman 6c6db8647b [crypto] Add AES key-wrap mode (RFC 3394)
The unwrapping half is used by WPA2 code; the wrapping half is currently
unused.

Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-01-05 09:06:15 -05:00
Joshua Oreman 2dfe4c414a [crypto] Make AES context size and algorithm structure externally available
This is required to support modes of AES beyond cipher-block chaining.

Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-01-05 09:04:25 -05:00
Joshua Oreman 59b7d00c06 [digest] Add HMAC-SHA1 based pseudorandom function and PBKDF2
Both of these routines are used by 802.11 WPA, but they are generic
and could be needed by other protocols as well.

Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-01-05 09:01:34 -05:00
Joshua Oreman 05d3be1048 [cipher] Add the ARC4 stream cipher
Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-01-05 09:00:20 -05:00
Joshua Oreman 7eaad90976 [digest] Add generic CRC32 function
Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-01-05 08:54:28 -05:00
Michael Brown c44a193d0d [legal] Add a selection of FILE_LICENCE declarations
Add FILE_LICENCE declarations to almost all files that make up the
various standard builds of gPXE.
2009-05-18 08:33:25 +01:00
Michael Brown 1c67623e37 [build] Enable building with the Intel C compiler (icc) 2009-03-26 07:27:19 +00:00
Michael Brown 9937bf13c9 [crypto] Allow creation of arbitrary CBC cipher algorithms using CBC_CIPHER()
Given any block cipher, a corresponding CBC mode of behaviour for the
cipher can be created using the CBC_CIPHER() macro.
2009-02-19 01:53:25 +00:00
Michael Brown e950dc04ba [crypto] Add our own general-purpose cipher-block chaining routines 2009-02-19 01:23:50 +00:00
Michael Brown b4d3d686cc [crypto] Change cipher_{en,de}crypt() to void functions
It is a programming error, not a runtime error, if we attempt to use
block ciphers with an incorrect blocksize, so use an assert() rather
than an error status return.
2009-02-19 00:06:41 +00:00
Michael Brown a3219b24a8 [crypto] Split crypto_algorithm into {digest,cipher,pubkey}_algorithm
The various types of cryptographic algorithm are fundamentally
different, and it was probably a mistake to try to handle them via a
single common type.

pubkey_algorithm is a placeholder type for now.
2009-02-18 22:17:41 +00:00
Michael Brown 5de8305feb [crypto] Move AES_convert_key() hack into axtls_aes.c
Although the nature of the hack is essentially unchanged, this allows
us to remove the hardcoded assumption in tls.c that the RX cipher is
AES.
2009-02-18 21:33:54 +00:00