MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC

The structures defined in RFC 5246 are not to have any padding between
fields or at the end; use the "pack" pragma as necessary.

Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=915
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Long Qin <qin.long@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
This commit is contained in:
Laszlo Ersek 2018-03-31 16:20:37 +02:00
parent ba9c8a8ccb
commit 344d057a2b
1 changed files with 10 additions and 0 deletions

View File

@ -141,10 +141,12 @@ typedef enum {
/// Hello Messages". The value of EFI_TLS_CIPHER is from TLS Cipher
/// Suite Registry of IANA.
///
#pragma pack (1)
typedef struct {
UINT8 Data1;
UINT8 Data2;
} EFI_TLS_CIPHER;
#pragma pack ()
///
/// EFI_TLS_COMPRESSION
@ -157,11 +159,13 @@ typedef UINT8 EFI_TLS_COMPRESSION;
/// Note: The definition of EFI_TLS_EXTENSION if from "RFC 5246 A.4.1.
/// Hello Messages".
///
#pragma pack (1)
typedef struct {
UINT16 ExtensionType;
UINT16 Length;
UINT8 Data[1];
} EFI_TLS_EXTENSION;
#pragma pack ()
///
/// EFI_TLS_VERIFY
@ -194,29 +198,35 @@ typedef UINT32 EFI_TLS_VERIFY;
/// Note: The definition of EFI_TLS_RANDOM is from "RFC 5246 A.4.1.
/// Hello Messages".
///
#pragma pack (1)
typedef struct {
UINT32 GmtUnixTime;
UINT8 RandomBytes[28];
} EFI_TLS_RANDOM;
#pragma pack ()
///
/// EFI_TLS_MASTER_SECRET
/// Note: The definition of EFI_TLS_MASTER_SECRET is from "RFC 5246 8.1.
/// Computing the Master Secret".
///
#pragma pack (1)
typedef struct {
UINT8 Data[48];
} EFI_TLS_MASTER_SECRET;
#pragma pack ()
///
/// EFI_TLS_SESSION_ID
/// Note: The definition of EFI_TLS_SESSION_ID is from "RFC 5246 A.4.1. Hello Messages".
///
#define MAX_TLS_SESSION_ID_LENGTH 32
#pragma pack (1)
typedef struct {
UINT16 Length;
UINT8 Data[MAX_TLS_SESSION_ID_LENGTH];
} EFI_TLS_SESSION_ID;
#pragma pack ()
///
/// EFI_TLS_SESSION_STATE