[tls] Split out hybrid MD5+SHA1 algorithm used in TLS version 1.1
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#ifndef _IPXE_MD5_SHA1_H
|
||||
#define _IPXE_MD5_SHA1_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* Hybrid MD5+SHA1 hash as used by TLSv1.1 and earlier
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
FILE_SECBOOT ( PERMITTED );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <ipxe/crypto.h>
|
||||
#include <ipxe/md5.h>
|
||||
#include <ipxe/sha1.h>
|
||||
|
||||
/** An MD5+SHA1 context */
|
||||
struct md5_sha1_context {
|
||||
/** MD5 context */
|
||||
uint8_t md5[MD5_CTX_SIZE];
|
||||
/** SHA-1 context */
|
||||
uint8_t sha1[SHA1_CTX_SIZE];
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/** MD5+SHA1 context size */
|
||||
#define MD5_SHA1_CTX_SIZE sizeof ( struct md5_sha1_context )
|
||||
|
||||
/** An MD5+SHA1 digest */
|
||||
struct md5_sha1_digest {
|
||||
/** MD5 digest */
|
||||
uint8_t md5[MD5_DIGEST_SIZE];
|
||||
/** SHA-1 digest */
|
||||
uint8_t sha1[SHA1_DIGEST_SIZE];
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/** MD5+SHA1 digest size */
|
||||
#define MD5_SHA1_DIGEST_SIZE sizeof ( struct md5_sha1_digest )
|
||||
|
||||
extern struct digest_algorithm md5_sha1_algorithm;
|
||||
|
||||
#endif /* _IPXE_MD5_SHA1_H */
|
||||
@@ -307,28 +307,6 @@ struct tls_client_random {
|
||||
uint8_t random[32];
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/** An MD5+SHA1 context */
|
||||
struct md5_sha1_context {
|
||||
/** MD5 context */
|
||||
uint8_t md5[MD5_CTX_SIZE];
|
||||
/** SHA-1 context */
|
||||
uint8_t sha1[SHA1_CTX_SIZE];
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/** MD5+SHA1 context size */
|
||||
#define MD5_SHA1_CTX_SIZE sizeof ( struct md5_sha1_context )
|
||||
|
||||
/** An MD5+SHA1 digest */
|
||||
struct md5_sha1_digest {
|
||||
/** MD5 digest */
|
||||
uint8_t md5[MD5_DIGEST_SIZE];
|
||||
/** SHA-1 digest */
|
||||
uint8_t sha1[SHA1_DIGEST_SIZE];
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/** MD5+SHA1 digest size */
|
||||
#define MD5_SHA1_DIGEST_SIZE sizeof ( struct md5_sha1_digest )
|
||||
|
||||
/** A TLS session */
|
||||
struct tls_session {
|
||||
/** Reference counter */
|
||||
|
||||
Reference in New Issue
Block a user