Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
This file contains common TLS 1.0/1.1/1.2 definitions from RFC 2246/4346/5246
This file contains common TLS 1.0/1.1/1.2 definitions from RFC 2246/4346/5246
- Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
/// TLS Content Type, refers to A.1 of rfc-2246, rfc-4346 and rfc-5246.
///
typedef enum {
/// TLS Content Type, refers to A.1 of rfc-2246, rfc-4346 and rfc-5246.
///
typedef enum {
- TLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC = 20,
- TLS_CONTENT_TYPE_ALERT = 21,
- TLS_CONTENT_TYPE_HANDSHAKE = 22,
- TLS_CONTENT_TYPE_APPLICATION_DATA = 23,
+ TlsContentTypeChangeCipherSpec = 20,
+ TlsContentTypeAlert = 21,
+ TlsContentTypeHandshake = 22,
+ TlsContentTypeApplicationData = 23,
/** @file\r
Miscellaneous routines for HttpDxe driver.\r
\r
/** @file\r
Miscellaneous routines for HttpDxe driver.\r
\r
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
Status = EFI_OUT_OF_RESOURCES;\r
return Status;\r
}\r
Status = EFI_OUT_OF_RESOURCES;\r
return Status;\r
}\r
- ((TLS_RECORD_HEADER *) Buffer)->ContentType = TLS_CONTENT_TYPE_APPLICATION_DATA;\r
+ ((TLS_RECORD_HEADER *) Buffer)->ContentType = TlsContentTypeApplicationData;\r
((TLS_RECORD_HEADER *) Buffer)->Version.Major = HttpInstance->TlsConfigData.Version.Major;\r
((TLS_RECORD_HEADER *) Buffer)->Version.Minor = HttpInstance->TlsConfigData.Version.Minor;\r
((TLS_RECORD_HEADER *) Buffer)->Length = (UINT16) (TxStringLen);\r
((TLS_RECORD_HEADER *) Buffer)->Version.Major = HttpInstance->TlsConfigData.Version.Major;\r
((TLS_RECORD_HEADER *) Buffer)->Version.Minor = HttpInstance->TlsConfigData.Version.Minor;\r
((TLS_RECORD_HEADER *) Buffer)->Length = (UINT16) (TxStringLen);\r
/** @file
Miscellaneous routines specific to Https for HttpDxe driver.
/** @file
Miscellaneous routines specific to Https for HttpDxe driver.
-Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
}
RecordHeader = *(TLS_RECORD_HEADER *) Header;
}
RecordHeader = *(TLS_RECORD_HEADER *) Header;
- if ((RecordHeader.ContentType == TLS_CONTENT_TYPE_HANDSHAKE ||
- RecordHeader.ContentType == TLS_CONTENT_TYPE_ALERT ||
- RecordHeader.ContentType == TLS_CONTENT_TYPE_CHANGE_CIPHER_SPEC ||
- RecordHeader.ContentType == TLS_CONTENT_TYPE_APPLICATION_DATA) &&
+ if ((RecordHeader.ContentType == TlsContentTypeHandshake ||
+ RecordHeader.ContentType == TlsContentTypeAlert ||
+ RecordHeader.ContentType == TlsContentTypeChangeCipherSpec ||
+ RecordHeader.ContentType == TlsContentTypeApplicationData) &&
(RecordHeader.Version.Major == 0x03) && /// Major versions are same.
(RecordHeader.Version.Minor == TLS10_PROTOCOL_VERSION_MINOR ||
RecordHeader.Version.Minor ==TLS11_PROTOCOL_VERSION_MINOR ||
(RecordHeader.Version.Major == 0x03) && /// Major versions are same.
(RecordHeader.Version.Minor == TLS10_PROTOCOL_VERSION_MINOR ||
RecordHeader.Version.Minor ==TLS11_PROTOCOL_VERSION_MINOR ||
//
RecordHeader = *(TLS_RECORD_HEADER *) BufferIn;
//
RecordHeader = *(TLS_RECORD_HEADER *) BufferIn;
- if ((RecordHeader.ContentType == TLS_CONTENT_TYPE_APPLICATION_DATA) &&
+ if ((RecordHeader.ContentType == TlsContentTypeApplicationData) &&
(RecordHeader.Version.Major == 0x03) &&
(RecordHeader.Version.Minor == TLS10_PROTOCOL_VERSION_MINOR ||
RecordHeader.Version.Minor == TLS11_PROTOCOL_VERSION_MINOR ||
(RecordHeader.Version.Major == 0x03) &&
(RecordHeader.Version.Minor == TLS10_PROTOCOL_VERSION_MINOR ||
RecordHeader.Version.Minor == TLS11_PROTOCOL_VERSION_MINOR ||
- ASSERT (((TLS_RECORD_HEADER *) (TempFragment.Bulk))->ContentType == TLS_CONTENT_TYPE_APPLICATION_DATA);
+ ASSERT (((TLS_RECORD_HEADER *) (TempFragment.Bulk))->ContentType == TlsContentTypeApplicationData);
BufferInSize = ((TLS_RECORD_HEADER *) (TempFragment.Bulk))->Length;
BufferIn = AllocateZeroPool (BufferInSize);
BufferInSize = ((TLS_RECORD_HEADER *) (TempFragment.Bulk))->Length;
BufferIn = AllocateZeroPool (BufferInSize);
//
FreePool (TempFragment.Bulk);
//
FreePool (TempFragment.Bulk);
- } else if ((RecordHeader.ContentType == TLS_CONTENT_TYPE_ALERT) &&
+ } else if ((RecordHeader.ContentType == TlsContentTypeAlert) &&
(RecordHeader.Version.Major == 0x03) &&
(RecordHeader.Version.Minor == TLS10_PROTOCOL_VERSION_MINOR ||
RecordHeader.Version.Minor == TLS11_PROTOCOL_VERSION_MINOR ||
(RecordHeader.Version.Major == 0x03) &&
(RecordHeader.Version.Minor == TLS10_PROTOCOL_VERSION_MINOR ||
RecordHeader.Version.Minor == TLS11_PROTOCOL_VERSION_MINOR ||
/** @file
The Miscellaneous Routines for TlsDxe driver.
/** @file
The Miscellaneous Routines for TlsDxe driver.
-Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
while ((UINTN) BufferInPtr < (UINTN) BufferIn + BufferInSize) {
RecordHeaderIn = (TLS_RECORD_HEADER *) BufferInPtr;
while ((UINTN) BufferInPtr < (UINTN) BufferIn + BufferInSize) {
RecordHeaderIn = (TLS_RECORD_HEADER *) BufferInPtr;
- if (RecordHeaderIn->ContentType != TLS_CONTENT_TYPE_APPLICATION_DATA) {
+ if (RecordHeaderIn->ContentType != TlsContentTypeApplicationData) {
Status = EFI_INVALID_PARAMETER;
goto ERROR;
}
Status = EFI_INVALID_PARAMETER;
goto ERROR;
}
while ((UINTN) BufferInPtr < (UINTN) BufferIn + BufferInSize) {
RecordHeaderIn = (TLS_RECORD_HEADER *) BufferInPtr;
while ((UINTN) BufferInPtr < (UINTN) BufferIn + BufferInSize) {
RecordHeaderIn = (TLS_RECORD_HEADER *) BufferInPtr;
- if (RecordHeaderIn->ContentType != TLS_CONTENT_TYPE_APPLICATION_DATA) {
+ if (RecordHeaderIn->ContentType != TlsContentTypeApplicationData) {
Status = EFI_INVALID_PARAMETER;
goto ERROR;
}
Status = EFI_INVALID_PARAMETER;
goto ERROR;
}
/** @file
Implementation of EFI TLS Protocol Interfaces.
/** @file
Implementation of EFI TLS Protocol Interfaces.
- Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
//
// Must be alert message, Decrypt it and build the ResponsePacket.
//
//
// Must be alert message, Decrypt it and build the ResponsePacket.
//
- ASSERT (((TLS_RECORD_HEADER *) RequestBuffer)->ContentType == TLS_CONTENT_TYPE_ALERT);
+ ASSERT (((TLS_RECORD_HEADER *) RequestBuffer)->ContentType == TlsContentTypeAlert);
Status = TlsHandleAlert (
Instance->TlsConn,
Status = TlsHandleAlert (
Instance->TlsConn,