Changeset 85718 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyBase.c
- Timestamp:
- Aug 12, 2020 4:09:12 PM (4 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-133213 /vendor/edk2/current 103735-103757,103769-103776,129194-139864
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyBase.c
r80721 r85718 13 13 #include <openssl/x509v3.h> 14 14 #include <openssl/pkcs7.h> 15 16 /** 17 Check the contents of PKCS7 is not data. 18 19 It is copied from PKCS7_type_is_other() in pk7_doit.c. 20 21 @param[in] P7 Pointer to the location at which the PKCS7 is located. 22 23 @retval TRUE If the type is others. 24 @retval FALSE If the type is expected. 25 **/ 26 STATIC 27 BOOLEAN 28 Pkcs7TypeIsOther ( 29 IN PKCS7 *P7 30 ) 31 { 32 BOOLEAN Others; 33 INTN Nid = OBJ_obj2nid (P7->type); 34 35 switch (Nid) { 36 case NID_pkcs7_data: 37 case NID_pkcs7_signed: 38 case NID_pkcs7_enveloped: 39 case NID_pkcs7_signedAndEnveloped: 40 case NID_pkcs7_encrypted: 41 Others = FALSE; 42 break; 43 default: 44 Others = TRUE; 45 } 46 47 return Others; 48 } 49 50 /** 51 Get the ASN.1 string for the PKCS7. 52 53 It is copied from PKCS7_get_octet_string() in pk7_doit.c. 54 55 @param[in] P7 Pointer to the location at which the PKCS7 is located. 56 57 @return ASN1_OCTET_STRING ASN.1 string. 58 **/ 59 STATIC 60 ASN1_OCTET_STRING* 61 Pkcs7GetOctetString ( 62 IN PKCS7 *P7 63 ) 64 { 65 if (PKCS7_type_is_data (P7)) { 66 return P7->d.data; 67 } 68 69 if (Pkcs7TypeIsOther(P7) && (P7->d.other != NULL) && 70 (P7->d.other->type == V_ASN1_OCTET_STRING)) { 71 return P7->d.other->value.octet_string; 72 } 73 74 return NULL; 75 } 15 76 16 77 /** … … 99 160 // Retrieve the attached content in PKCS7 signedData 100 161 // 101 OctStr = Pkcs7->d.sign->contents->d.data; 162 OctStr = Pkcs7GetOctetString (Pkcs7->d.sign->contents); 163 if (OctStr == NULL) { 164 goto _Exit; 165 } 166 102 167 if ((OctStr->length > 0) && (OctStr->data != NULL)) { 103 168 *ContentSize = OctStr->length;
Note:
See TracChangeset
for help on using the changeset viewer.