Changeset 58466 in vbox for trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg
- Timestamp:
- Oct 29, 2015 4:30:44 AM (9 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 52 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
- Property svn:mergeinfo changed
/vendor/edk2/current merged: 103769-103776
- Property svn:mergeinfo changed
-
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Application/Cryptest/AuthenticodeVerify.c
r48674 r58466 1 /** @file 1 /** @file 2 2 Sample Implementation for Microsoft Authenticode Verification. 3 3 … … 20 20 // 21 21 GLOBAL_REMOVE_IF_UNREFERENCED UINT8 PeSha1Hash[] = { 22 0x44, 0xFD, 0x4F, 0xA9, 0x17, 0xEE, 0xAC, 0xCF, 0x1F, 0x0B, 0xE3, 0xA1, 0x4D, 0x5B, 0xA6, 0x61, 22 0x44, 0xFD, 0x4F, 0xA9, 0x17, 0xEE, 0xAC, 0xCF, 0x1F, 0x0B, 0xE3, 0xA1, 0x4D, 0x5B, 0xA6, 0x61, 23 23 0x82, 0x97, 0xC4, 0xB6 24 24 }; … … 34 34 // 35 35 // Sample Authenticode Data with SHA-1 hash algorithm. 36 // This data should be retrieved from signed PE/COFF image according to SECURITY 36 // This data should be retrieved from signed PE/COFF image according to SECURITY 37 37 // directory in PE/COFF Header. 38 38 // … … 169 169 0xE8, 0x28, 0x62, 0xC2, 0xF3, 0xC2, 0x23, 0xA6, 0x1C, 0x49, 0x82, 0x0B, 0xD5, 0x53, 0x30, 0x0E, 170 170 0x06, 0x03, 0x55, 0x1D, 0x0F, 0x01, 0x01, 0xFF, 0x04, 0x04, 0x03, 0x02, 0x07, 0x80, 0x30, 0x1F, 171 0x06, 0x03, 0x55, 0x1D, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x90, 0x8B, 0x11, 171 0x06, 0x03, 0x55, 0x1D, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x90, 0x8B, 0x11, 172 172 0xA5, 0x70, 0xED, 0xE0, 0xF9, 0xA9, 0xC0, 0xAC, 0x08, 0xC7, 0xB5, 0xF4, 0x82, 0xB1, 0x3C, 0xC5, 173 173 0x4A, 0x30, 0x7B, 0x06, 0x03, 0x55, 0x1D, 0x1F, 0x04, 0x74, 0x30, 0x72, 0x30, 0x70, 0xA0, 0x6E, … … 490 490 0x0E, 0x99, 0x1F, 0xDF, 0x7E, 0xC9, 0x10, 0x56, 0xC7, 0x00, 0x6D, 0x5F, 0x23, 0x57, 0x12, 0x84, 491 491 0xCD, 0xAC, 0x82, 0xAE, 0x39, 0x52, 0xA5, 0x19, 0x23, 0xA3, 0x6B, 0xE7, 0x49, 0x8F, 0x86, 0x74, 492 0x46, 0x41, 0x2A, 0x0F, 0x3D, 0x29, 0xB7, 0xAE, 0x8C, 0x00 492 0x46, 0x41, 0x2A, 0x0F, 0x3D, 0x29, 0xB7, 0xAE, 0x8C, 0x00 493 493 }; 494 494 495 495 // 496 496 // Sample Authenticode Data with SHA-256 hash algorithm. 497 // This data should be retrieved from signed PE/COFF image according to SECURITY 497 // This data should be retrieved from signed PE/COFF image according to SECURITY 498 498 // directory in PE/COFF Header. 499 499 // … … 740 740 741 741 // 742 // Sample root certificate for code signing. 743 // A trusted certificate with self-signing, will be used to construct the certificate chains for 742 // Sample root certificate for code signing. 743 // A trusted certificate with self-signing, will be used to construct the certificate chains for 744 744 // authority checking. 745 745 // … … 965 965 Status = FALSE; 966 966 Print (L"\n- PE/COFF Authenticode (Digested by SHA-1) Verification ... "); 967 967 968 968 // 969 969 // Sample Code: Demonstrate how to check the Hash algorithm in PE/COFF Authenticode. 970 // According to PKCS#7 Definition: 970 // According to PKCS#7 Definition: 971 971 // SignedData ::= SEQUENCE { 972 972 // version Version, … … 976 976 // The DigestAlgorithmIdentifiers can be used to determine the hash algorithm in PE/COFF hashing 977 977 // This field has the fixed offset (+32) in final Authenticode ASN.1 data. 978 // 978 // 979 979 if (CompareMem (AuthenticodeWithSha1 + 32, &HashOidValue[8], 5) == 0) { 980 980 // 981 // Verify Authenticode signature. 981 // Verify Authenticode signature. 982 982 // The PeHash value should be calculated following MSFT's Authenticode Specification. 983 983 // … … 994 994 } else { 995 995 Print (L"[Fail]"); 996 } 996 } 997 997 } else { 998 998 Print (L"[Invalid Hash]"); … … 1015 1015 } else { 1016 1016 Print (L"[Fail]"); 1017 } 1017 } 1018 1018 } else { 1019 1019 Print (L"[Invalid Hash]"); -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Application/Cryptest/BlockCipherVerify.c
r48674 r58466 1 /** @file 1 /** @file 2 2 Application for Block Cipher Primitives Validation. 3 3 … … 42 42 43 43 GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 TdesCbcKey[] = { 44 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 44 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 45 45 0xf1, 0xe0, 0xd3, 0xc2, 0xb5, 0xa4, 0x97, 0x86, 46 46 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 … … 223 223 Print (L"[Fail]"); 224 224 return EFI_ABORTED; 225 } 225 } 226 226 227 227 if (CompareMem (Decrypt, TdesEcbData, 8) != 0) { … … 272 272 CtxSize = AesGetContextSize (); 273 273 CipherCtx = AllocatePool (CtxSize); 274 274 275 275 Print (L"\n- AES Validation: "); 276 276 … … 304 304 Print (L"[Fail]"); 305 305 return EFI_ABORTED; 306 } 306 } 307 307 308 308 if (CompareMem (Decrypt, Aes128EcbData, sizeof (Aes128EcbData)) != 0) { -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Application/Cryptest/Cryptest.inf
r58459 r58466 9 9 # which accompanies this distribution. The full text of the license may be found at 10 10 # http://opensource.org/licenses/bsd-license.php 11 # 11 # 12 12 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 13 13 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 14 # 14 # 15 15 ## 16 16 … … 42 42 DhVerify.c 43 43 RandVerify.c 44 44 45 45 [Packages] 46 46 MdePkg/MdePkg.dec … … 59 59 [UserExtensions.TianoCore."ExtraFiles"] 60 60 CryptestExtra.uni 61 61 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Application/Cryptest/HmacVerify.c
r48674 r58466 1 /** @file 1 /** @file 2 2 Application for HMAC Primitives Validation. 3 3 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Application/Cryptest/RandVerify.c
r48674 r58466 1 /** @file 1 /** @file 2 2 Application for Pseudorandom Number Generator Validation. 3 3 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Application/Cryptest/RsaVerify.c
r48674 r58466 1 /** @file 1 /** @file 2 2 Application for RSA Primitives Validation. 3 3 … … 25 25 // 26 26 GLOBAL_REMOVE_IF_UNREFERENCED CONST UINT8 RsaN[] = { 27 0xBB, 0xF8, 0x2F, 0x09, 0x06, 0x82, 0xCE, 0x9C, 0x23, 0x38, 0xAC, 0x2B, 0x9D, 0xA8, 0x71, 0xF7, 27 0xBB, 0xF8, 0x2F, 0x09, 0x06, 0x82, 0xCE, 0x9C, 0x23, 0x38, 0xAC, 0x2B, 0x9D, 0xA8, 0x71, 0xF7, 28 28 0x36, 0x8D, 0x07, 0xEE, 0xD4, 0x10, 0x43, 0xA4, 0x40, 0xD6, 0xB6, 0xF0, 0x74, 0x54, 0xF5, 0x1F, 29 29 0xB8, 0xDF, 0xBA, 0xAF, 0x03, 0x5C, 0x02, 0xAB, 0x61, 0xEA, 0x48, 0xCE, 0xEB, 0x6F, 0xCD, 0x48, … … 235 235 return EFI_ABORTED; 236 236 } 237 237 238 238 if (KeySize != 3 || 239 239 CompareMem (KeyBuffer, DefaultPublicKey, 3) != 0) { … … 300 300 301 301 // 302 // SHA-1 Digest Message for PKCS#1 Signature 302 // SHA-1 Digest Message for PKCS#1 Signature 303 303 // 304 304 Print (L"Hash Original Message ... "); -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Application/Cryptest/RsaVerify2.c
r48674 r58466 1 /** @file 1 /** @file 2 2 Application for RSA Key Retrieving (from PEM and X509) & Signature Validation. 3 3 … … 73 73 0x13, 0x05, 0x49, 0x4e, 0x54, 0x45, 0x4c, 0x31, 0x0c, 0x30, 0x0a, 0x06, 0x03, 0x55, 0x04, 0x0b, 74 74 0x13, 0x03, 0x50, 0x53, 0x49, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x04, 75 0x55, 0x45, 0x46, 0x49, 0x31, 0x1b, 0x30, 0x19, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 75 0x55, 0x45, 0x46, 0x49, 0x31, 0x1b, 0x30, 0x19, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 76 76 0x01, 0x09, 0x01, 0x16, 0x0c, 0x75, 0x65, 0x66, 0x69, 0x40, 0x70, 0x73, 0x69, 0x2e, 0x63, 0x6f, 77 77 0x6d, 0x30, 0x1e, 0x17, 0x0d, 0x31, 0x30, 0x31, 0x30, 0x30, 0x38, 0x31, 0x38, 0x31, 0x35, 0x33, … … 346 346 347 347 // 348 // Create PKCS#7 signedData on Payload. 348 // Create PKCS#7 signedData on Payload. 349 349 // Note: Caller should release P7SignedData manually. 350 350 // -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Application/Cryptest/TSVerify.c
r58464 r58466 17 17 // 18 18 // Sample Authenticode Data with RFC3161 time stamping signature. 19 // The data retrieved from one signed sample UEFI image, which is generated by MSFT's signtool 19 // The data retrieved from one signed sample UEFI image, which is generated by MSFT's signtool 20 20 // utility in conjunction with RFC3161 timestamping, as the following command: 21 // signtool sign /ac <xxx.cer> / f <xxx.pfx> /p <pass> /fd <digestAlg> 21 // signtool sign /ac <xxx.cer> / f <xxx.pfx> /p <pass> /fd <digestAlg> 22 22 // /tr http://timestamp.comodoca.com/rfc3161 sample.efi 23 23 // -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/CryptRuntimeDxe/CryptRuntimeDxe.inf
r58459 r58466 7 7 # which accompanies this distribution. The full text of the license may be found at 8 8 # http://opensource.org/licenses/bsd-license.php 9 # 9 # 10 10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 # 12 # 13 13 ## 14 14 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/CryptoPkg.dec
-
Property svn:eol-style
set to
native
r58459 r58466 10 10 # which accompanies this distribution. The full text of the license may be found at 11 11 # http://opensource.org/licenses/bsd-license.php 12 # 12 # 13 13 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 14 14 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 15 # 15 # 16 16 ## 17 17 … … 37 37 [UserExtensions.TianoCore."ExtraFiles"] 38 38 CryptoPkgExtra.uni 39 39 -
Property svn:eol-style
set to
-
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/CryptoPkg.dsc
r58459 r58466 7 7 # which accompanies this distribution. The full text of the license may be found at 8 8 # http://opensource.org/licenses/bsd-license.php 9 # 9 # 10 10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 11 11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 12 # 12 # 13 13 ## 14 14 … … 39 39 PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf 40 40 DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf 41 DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf 41 DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf 42 42 PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf 43 43 UefiLib|MdePkg/Library/UefiLib/UefiLib.inf -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Include/OpenSslSupport.h
r58459 r58466 23 23 24 24 // 25 // File operations are not required for building Open SSL, 25 // File operations are not required for building Open SSL, 26 26 // so FILE is mapped to VOID * to pass build 27 27 // -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Include/math.h
r48674 r58466 1 1 /** @file 2 Include file to support building OPEN SSL 2 Include file to support building OPEN SSL 3 3 4 4 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR> -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Cipher/CryptAes.c
r58459 r58466 126 126 return FALSE; 127 127 } 128 128 129 129 AesKey = (AES_KEY *) AesContext; 130 130 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Cipher/CryptAesNull.c
r58464 r58466 1 1 /** @file 2 AES Wrapper Implementation which does not provide real capabilities. 3 2 AES Wrapper Implementation which does not provide real capabilities. 3 4 4 Copyright (c) 2012, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials … … 61 61 62 62 Return FALSE to indicate this interface is not supported. 63 63 64 64 @param[in] AesContext Pointer to the AES context. 65 65 @param[in] Input Pointer to the buffer containing the data to be encrypted. 66 66 @param[in] InputSize Size of the Input buffer in bytes. 67 67 @param[out] Output Pointer to a buffer that receives the AES encryption output. 68 68 69 69 @retval FALSE This interface is not supported. 70 70 … … 160 160 OUT UINT8 *Output 161 161 ) 162 { 162 { 163 163 ASSERT (FALSE); 164 164 return FALSE; -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4.c
r58459 r58466 67 67 // 68 68 // Check input parameters. 69 // 69 // 70 70 if (Arc4Context == NULL || Key == NULL || (KeySize < 5 || KeySize > 256)) { 71 71 return FALSE; … … 203 203 return FALSE; 204 204 } 205 205 206 206 Rc4Key = (RC4_KEY *) Arc4Context; 207 207 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Cipher/CryptArc4Null.c
r58464 r58466 1 /** @file 1 /** @file 2 2 ARC4 Wrapper Implementation which does not provide real capabilities. 3 3 … … 79 79 OUT UINT8 *Output 80 80 ) 81 { 81 { 82 82 ASSERT (FALSE); 83 83 return FALSE; -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Hash/CryptMd4Null.c
r58464 r58466 104 104 Completes computation of the MD4 digest value. 105 105 106 Return FALSE to indicate this interface is not supported. 106 Return FALSE to indicate this interface is not supported. 107 107 108 108 @param[in, out] Md4Context Pointer to the MD4 context. -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacMd5.c
r58459 r58466 98 98 return FALSE; 99 99 } 100 100 101 101 CopyMem (NewHmacMd5Context, HmacMd5Context, sizeof (HMAC_CTX)); 102 102 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacMd5Null.c
r58464 r58466 35 35 /** 36 36 Initializes user-supplied memory pointed by HmacMd5Context as HMAC-MD5 context for 37 subsequent use. 37 subsequent use. 38 38 39 Return FALSE to indicate this interface is not supported. 39 Return FALSE to indicate this interface is not supported. 40 40 41 41 @param[out] HmacMd5Context Pointer to HMAC-MD5 context being initialized. -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Hmac/CryptHmacSha1Null.c
r58464 r58466 1 1 /** @file 2 HMAC-SHA1 Wrapper Implementation which does not provide real capabilities. 2 HMAC-SHA1 Wrapper Implementation which does not provide real capabilities. 3 3 4 4 Copyright (c) 2012, Intel Corporation. All rights reserved.<BR> … … 37 37 subsequent use. 38 38 39 Return FALSE to indicate this interface is not supported. 39 Return FALSE to indicate this interface is not supported. 40 40 41 41 @param[out] HmacSha1Context Pointer to HMAC-SHA1 context being initialized. … … 83 83 Digests the input data and updates HMAC-SHA1 context. 84 84 85 Return FALSE to indicate this interface is not supported. 85 Return FALSE to indicate this interface is not supported. 86 86 87 87 @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 context. … … 107 107 Completes computation of the HMAC-SHA1 digest value. 108 108 109 Return FALSE to indicate this interface is not supported. 109 Return FALSE to indicate this interface is not supported. 110 110 111 111 @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 context. -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/InternalCryptLib.h
r58459 r58466 1 /** @file 1 /** @file 2 2 Internal include file for BaseCryptLib. 3 3 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf
r58459 r58466 8 8 # 9 9 # Note: MD4 Digest functions, SHA-384 Digest functions, SHA-512 Digest functions, 10 # HMAC-MD5 functions, HMAC-SHA1 functions, AES/TDES/ARC4 functions, RSA external 11 # functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, X.509 12 # certificate handler functions, authenticode signature verification functions, 13 # PEM handler functions, and pseudorandom number generator functions are not 10 # HMAC-MD5 functions, HMAC-SHA1 functions, AES/TDES/ARC4 functions, RSA external 11 # functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, X.509 12 # certificate handler functions, authenticode signature verification functions, 13 # PEM handler functions, and pseudorandom number generator functions are not 14 14 # supported in this instance. 15 15 # -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Pem/CryptPem.c
r58459 r58466 29 29 INTN 30 30 PasswordCallback ( 31 OUT CHAR8 *Buf, 32 IN INTN Size, 33 IN INTN Flag, 31 OUT CHAR8 *Buf, 32 IN INTN Size, 33 IN INTN Flag, 34 34 IN VOID *Key 35 35 ) -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Pk/CryptDh.c
r58459 r58466 61 61 Given generator g, and length of prime number p in bits, this function generates p, 62 62 and sets DH context according to value of g and p. 63 63 64 64 Before this function can be invoked, pseudorandom number generator must be correctly 65 65 initialized by RandomSeed(). … … 149 149 return FALSE; 150 150 } 151 151 152 152 if (Generator != DH_GENERATOR_2 && Generator != DH_GENERATOR_5) { 153 153 return FALSE; … … 162 162 goto Error; 163 163 } 164 164 165 165 Dh->g = BN_new (); 166 166 if (Dh->g == NULL) { … … 192 192 BN_free (Bn); 193 193 } 194 194 195 195 return FALSE; 196 196 } … … 199 199 Generates DH public key. 200 200 201 This function generates random secret exponent, and computes the public key, which is 201 This function generates random secret exponent, and computes the public key, which is 202 202 returned via parameter PublicKey and PublicKeySize. DH context is updated accordingly. 203 203 If the PublicKey buffer is too small to hold the public key, FALSE is returned and … … 240 240 return FALSE; 241 241 } 242 242 243 243 Dh = (DH *) DhContext; 244 244 … … 250 250 return FALSE; 251 251 } 252 252 253 253 BN_bn2bin (Dh->pub_key, PublicKey); 254 254 *PublicKeySize = Size; … … 262 262 263 263 Given peer's public key, this function computes the exchanged common key, based on its own 264 context including value of prime modulus and random secret exponent. 264 context including value of prime modulus and random secret exponent. 265 265 266 266 If DhContext is NULL, then return FALSE. … … 305 305 return FALSE; 306 306 } 307 307 308 308 Bn = BN_bin2bn (PeerPublicKey, (UINT32) PeerPublicKeySize, NULL); 309 309 if (Bn == NULL) { -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Pk/CryptDhNull.c
r58464 r58466 99 99 { 100 100 ASSERT (FALSE); 101 return FALSE; 101 return FALSE; 102 102 } 103 103 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7Sign.c
r58464 r58466 122 122 123 123 // 124 // Convert the data to be signed to BIO format. 124 // Convert the data to be signed to BIO format. 125 125 // 126 126 DataBio = BIO_new (BIO_s_mem ()); -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyNull.c
r58464 r58466 54 54 55 55 If the interface is not supported, then ASSERT(). 56 56 57 57 @param[in] Certs Pointer to the certificates to be freed. 58 58 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaBasic.c
r58464 r58466 305 305 // 306 306 // Determine the message digest algorithm according to digest size. 307 // Only MD5, SHA-1 or SHA-256 algorithm is supported. 307 // Only MD5, SHA-1 or SHA-256 algorithm is supported. 308 308 // 309 309 switch (HashSize) { … … 311 311 DigestType = NID_md5; 312 312 break; 313 313 314 314 case SHA1_DIGEST_SIZE: 315 315 DigestType = NID_sha1; 316 316 break; 317 317 318 318 case SHA256_DIGEST_SIZE: 319 319 DigestType = NID_sha256; -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaExt.c
r58464 r58466 173 173 } 174 174 *BnSize = BN_bn2bin (BnKey, BigNumber) ; 175 175 176 176 return TRUE; 177 177 } … … 192 192 @param[in] ModulusLength Length of RSA modulus N in bits. 193 193 @param[in] PublicExponent Pointer to RSA public exponent. 194 @param[in] PublicExponentSize Size of RSA public exponent buffer in bytes. 194 @param[in] PublicExponentSize Size of RSA public exponent buffer in bytes. 195 195 196 196 @retval TRUE RSA key component was generated successfully. … … 216 216 return FALSE; 217 217 } 218 218 219 219 KeyE = BN_new (); 220 220 if (KeyE == NULL) { … … 223 223 224 224 RetVal = FALSE; 225 225 226 226 if (PublicExponent == NULL) { 227 227 if (BN_set_word (KeyE, 0x10001) == 0) { … … 244 244 245 245 /** 246 Validates key components of RSA context. 246 Validates key components of RSA context. 247 247 NOTE: This function performs integrity checks on all the RSA key material, so 248 248 the RSA key structure must contain all the private key data. … … 276 276 return FALSE; 277 277 } 278 278 279 279 if (RSA_check_key ((RSA *) RsaContext) != 1) { 280 280 Reason = ERR_GET_REASON (ERR_peek_last_error ()); … … 343 343 return FALSE; 344 344 } 345 345 346 346 if (Signature == NULL) { 347 347 return FALSE; 348 348 } 349 349 350 350 // 351 351 // Determine the message digest algorithm according to digest size. 352 // Only MD5, SHA-1 or SHA-256 algorithm is supported. 352 // Only MD5, SHA-1 or SHA-256 algorithm is supported. 353 353 // 354 354 switch (HashSize) { … … 356 356 DigestType = NID_md5; 357 357 break; 358 358 359 359 case SHA1_DIGEST_SIZE: 360 360 DigestType = NID_sha1; 361 361 break; 362 362 363 363 case SHA256_DIGEST_SIZE: 364 364 DigestType = NID_sha256; … … 367 367 default: 368 368 return FALSE; 369 } 369 } 370 370 371 371 return (BOOLEAN) RSA_sign ( -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Pk/CryptRsaExtNull.c
r58464 r58466 56 56 @param[in] ModulusLength Length of RSA modulus N in bits. 57 57 @param[in] PublicExponent Pointer to RSA public exponent. 58 @param[in] PublicExponentSize Size of RSA public exponent buffer in bytes. 58 @param[in] PublicExponentSize Size of RSA public exponent buffer in bytes. 59 59 60 60 @retval FALSE This interface is not supported. -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c
r58459 r58466 74 74 by certificate size. A NULL terminates the list. The 75 75 pairs are the arguments to X509ConstructCertificate(). 76 76 77 77 @retval TRUE The X509 stack construction succeeded. 78 78 @retval FALSE The construction operation failed. … … 83 83 X509ConstructCertificateStack ( 84 84 IN OUT UINT8 **X509Stack, 85 ... 85 ... 86 86 ) 87 87 { … … 176 176 IN VOID *X509Cert 177 177 ) 178 { 178 { 179 179 // 180 180 // Check input parameters. … … 183 183 return; 184 184 } 185 185 186 186 // 187 187 // Free OpenSSL X509 object. … … 210 210 return; 211 211 } 212 212 213 213 // 214 214 // Free OpenSSL X509 stack object. … … 323 323 EVP_PKEY *Pkey; 324 324 X509 *X509Cert; 325 325 326 326 // 327 327 // Check input parameters. … … 370 370 if (Pkey != NULL) { 371 371 EVP_PKEY_free (Pkey); 372 } 372 } 373 373 374 374 return Status; … … 405 405 X509_STORE *CertStore; 406 406 X509_STORE_CTX CertCtx; 407 407 408 408 // 409 409 // Check input parameters. … … 490 490 X509_STORE_free (CertStore); 491 491 } 492 492 493 493 return Status; 494 494 } … … 567 567 568 568 *TBSCertSize = Length + (Temp - *TBSCert); 569 569 570 570 return TRUE; 571 571 } -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509Null.c
r58464 r58466 51 51 by certificate size. A NULL terminates the list. The 52 52 pairs are the arguments to X509ConstructCertificate(). 53 53 54 54 @retval FALSE This interface is not supported. 55 55 … … 59 59 X509ConstructCertificateStack ( 60 60 IN OUT UINT8 **X509Stack, 61 ... 61 ... 62 62 ) 63 63 { … … 79 79 IN VOID *X509Cert 80 80 ) 81 { 81 { 82 82 ASSERT (FALSE); 83 83 } … … 165 165 166 166 @retval FALSE This interface is not supported. 167 167 168 168 **/ 169 169 BOOLEAN -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c
r58459 r58466 70 70 "UEFI Crypto Library default seed (%ld)", 71 71 AsmReadItc () 72 ); 72 ); 73 73 74 74 RAND_seed (DefaultSeed, sizeof (DefaultSeed)); -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c
r58459 r58466 70 70 "UEFI Crypto Library default seed (%ld)", 71 71 AsmReadTsc () 72 ); 72 ); 73 73 74 74 RAND_seed (DefaultSeed, sizeof (DefaultSeed)); -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
r58459 r58466 9 9 # Note: MD4 Digest functions, SHA-384 Digest functions, SHA-512 Digest functions, 10 10 # HMAC-MD5 functions, HMAC-SHA1 functions, AES/TDES/ARC4 functions, RSA external 11 # functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and 11 # functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and 12 12 # authenticode signature verification functions are not supported in this instance. 13 13 # -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf
r58459 r58466 9 9 # Note: MD4 Digest functions, SHA-384 Digest functions, SHA-512 Digest functions, 10 10 # HMAC-MD5 functions, HMAC-SHA1 functions, AES/TDES/ARC4 functions, RSA external 11 # functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and 11 # functions, PKCS#7 SignedData sign functions, Diffie-Hellman functions, and 12 12 # authenticode signature verification functions are not supported in this instance. 13 13 # -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
r58459 r58466 63 63 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, 64 64 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, 65 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 65 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 66 66 } 67 67 }; … … 92 92 // Add in number of seconds for current Month, Day, Hour, Minute, Seconds, and TimeZone adjustment 93 93 // 94 *timer = *timer + 94 *timer = *timer + 95 95 (time_t)((Time.TimeZone != EFI_UNSPECIFIED_TIMEZONE) ? (Time.TimeZone * 60) : 0) + 96 (time_t)(CumulativeDays[IsLeap(Time.Year)][Time.Month] * SECSPERDAY) + 97 (time_t)(((Time.Day > 0) ? Time.Day - 1 : 0) * SECSPERDAY) + 98 (time_t)(Time.Hour * SECSPERHOUR) + 99 (time_t)(Time.Minute * 60) + 96 (time_t)(CumulativeDays[IsLeap(Time.Year)][Time.Month] * SECSPERDAY) + 97 (time_t)(((Time.Day > 0) ? Time.Day - 1 : 0) * SECSPERDAY) + 98 (time_t)(Time.Hour * SECSPERHOUR) + 99 (time_t)(Time.Minute * 60) + 100 100 (time_t)Time.Second; 101 101 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/BaseCryptLibRuntimeCryptProtocol.inf
r58459 r58466 3 3 # This instance will be only used by the Authenticated Variable driver for IPF. 4 4 # 5 # Note: MD4/MD5/SHA1 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, 5 # Note: MD4/MD5/SHA1 Digest functions, HMAC-MD5 functions, HMAC-SHA1 functions, 6 6 # AES/TDES/ARC4 functions, RSA external functions, PKCS#7 SignedData sign/verify 7 7 # functions, Diffie-Hellman functions, X.509 certificate handler functions, … … 15 15 # which accompanies this distribution. The full text of the license may be found at 16 16 # http://opensource.org/licenses/bsd-license.php 17 # 17 # 18 18 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 19 19 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 20 # 20 # 21 21 ## 22 22 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Cipher/CryptAesNull.c
r58464 r58466 1 1 /** @file 2 AES Wrapper Implementation which does not provide real capabilities. 3 2 AES Wrapper Implementation which does not provide real capabilities. 3 4 4 Copyright (c) 2012, Intel Corporation. All rights reserved.<BR> 5 5 This program and the accompanying materials … … 61 61 62 62 Return FALSE to indicate this interface is not supported. 63 63 64 64 @param[in] AesContext Pointer to the AES context. 65 65 @param[in] Input Pointer to the buffer containing the data to be encrypted. 66 66 @param[in] InputSize Size of the Input buffer in bytes. 67 67 @param[out] Output Pointer to a buffer that receives the AES encryption output. 68 68 69 69 @retval FALSE This interface is not supported. 70 70 … … 160 160 OUT UINT8 *Output 161 161 ) 162 { 162 { 163 163 ASSERT (FALSE); 164 164 return FALSE; -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Cipher/CryptArc4Null.c
r58464 r58466 1 /** @file 1 /** @file 2 2 ARC4 Wrapper Implementation which does not provide real capabilities. 3 3 … … 79 79 OUT UINT8 *Output 80 80 ) 81 { 81 { 82 82 ASSERT (FALSE); 83 83 return FALSE; -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hash/CryptMd4Null.c
r58464 r58466 104 104 Completes computation of the MD4 digest value. 105 105 106 Return FALSE to indicate this interface is not supported. 106 Return FALSE to indicate this interface is not supported. 107 107 108 108 @param[in, out] Md4Context Pointer to the MD4 context. -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hash/CryptSha1Null.c
r58464 r58466 32 32 { 33 33 ASSERT (FALSE); 34 return 0; 34 return 0; 35 35 } 36 36 … … 40 40 41 41 Return FALSE to indicate this interface is not supported. 42 42 43 43 @param[out] Sha1Context Pointer to SHA-1 context being initialized. 44 44 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hmac/CryptHmacMd5Null.c
r58464 r58466 35 35 /** 36 36 Initializes user-supplied memory pointed by HmacMd5Context as HMAC-MD5 context for 37 subsequent use. 37 subsequent use. 38 38 39 Return FALSE to indicate this interface is not supported. 39 Return FALSE to indicate this interface is not supported. 40 40 41 41 @param[out] HmacMd5Context Pointer to HMAC-MD5 context being initialized. -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Hmac/CryptHmacSha1Null.c
r58464 r58466 1 1 /** @file 2 HMAC-SHA1 Wrapper Implementation which does not provide real capabilities. 2 HMAC-SHA1 Wrapper Implementation which does not provide real capabilities. 3 3 4 4 Copyright (c) 2012, Intel Corporation. All rights reserved.<BR> … … 37 37 subsequent use. 38 38 39 Return FALSE to indicate this interface is not supported. 39 Return FALSE to indicate this interface is not supported. 40 40 41 41 @param[out] HmacSha1Context Pointer to HMAC-SHA1 context being initialized. … … 83 83 Digests the input data and updates HMAC-SHA1 context. 84 84 85 Return FALSE to indicate this interface is not supported. 85 Return FALSE to indicate this interface is not supported. 86 86 87 87 @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 context. … … 107 107 Completes computation of the HMAC-SHA1 digest value. 108 108 109 Return FALSE to indicate this interface is not supported. 109 Return FALSE to indicate this interface is not supported. 110 110 111 111 @param[in, out] HmacSha1Context Pointer to the HMAC-SHA1 context. -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/InternalCryptLib.h
r58464 r58466 1 /** @file 1 /** @file 2 2 Internal include file for BaseCryptLibRuntimeCryptProtocol. 3 3 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptDhNull.c
r58464 r58466 99 99 { 100 100 ASSERT (FALSE); 101 return FALSE; 101 return FALSE; 102 102 } 103 103 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptPkcs7VerifyNull.c
r58464 r58466 54 54 55 55 If the interface is not supported, then ASSERT(). 56 56 57 57 @param[in] Certs Pointer to the certificates to be freed. 58 58 -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptRsaExtNull.c
r58464 r58466 56 56 @param[in] ModulusLength Length of RSA modulus N in bits. 57 57 @param[in] PublicExponent Pointer to RSA public exponent. 58 @param[in] PublicExponentSize Size of RSA public exponent buffer in bytes. 58 @param[in] PublicExponentSize Size of RSA public exponent buffer in bytes. 59 59 60 60 @retval FALSE This interface is not supported. -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/BaseCryptLibRuntimeCryptProtocol/Pk/CryptX509Null.c
r58464 r58466 51 51 by certificate size. A NULL terminates the list. The 52 52 pairs are the arguments to X509ConstructCertificate(). 53 53 54 54 @retval FALSE This interface is not supported. 55 55 … … 59 59 X509ConstructCertificateStack ( 60 60 IN OUT UINT8 **X509Stack, 61 ... 61 ... 62 62 ) 63 63 { … … 79 79 IN VOID *X509Cert 80 80 ) 81 { 81 { 82 82 ASSERT (FALSE); 83 83 } … … 165 165 166 166 @retval FALSE This interface is not supported. 167 167 168 168 **/ 169 169 BOOLEAN -
trunk/src/VBox/Devices/EFI/Firmware/CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
r58459 r58466 26 26 // 27 27 // NOTE: Here we use one base implementation for memset, instead of the direct 28 // optimized SetMem() wrapper. Because the IntrinsicLib has to be built 29 // without whole program optimization option, and there will be some 28 // optimized SetMem() wrapper. Because the IntrinsicLib has to be built 29 // without whole program optimization option, and there will be some 30 30 // potential register usage errors when calling other optimized codes. 31 31 // … … 42 42 *(Pointer++) = ch; 43 43 } 44 44 45 45 return dest; 46 46 }
Note:
See TracChangeset
for help on using the changeset viewer.