X509Cert.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. /*
  2. * Copyright (C) 2011-2018 Intel Corporation. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * * Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * * Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in
  12. * the documentation and/or other materials provided with the
  13. * distribution.
  14. * * Neither the name of Intel Corporation nor the names of its
  15. * contributors may be used to endorse or promote products derived
  16. * from this software without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. *
  30. */
  31. /**
  32. @file X509Cert.h
  33. @author Kapil Anantharaman
  34. @brief This file contains the data structures for the X509 certificates for verifier and EPID group .
  35. */
  36. #ifndef _X509CERT_H_
  37. #define _X509CERT_H_
  38. #include "typedef.h"
  39. #include "X509AlgoType.h"
  40. #include "pse_pr_sigma_1_1_defs.h"
  41. typedef UINT32 Uint32 ;
  42. typedef UINT8 Uint8;
  43. typedef UINT16 Uint16;
  44. typedef void X509_PROTOCOL;
  45. typedef UINT32 STATUS;
  46. #define DER_ENCODING_BOOLEAN_ID 0x01
  47. #define DER_ENCODING_INTEGER_ID 0x02
  48. #define DER_ENCODING_BIT_STRING_ID 0x03
  49. #define DER_ENCODING_OCTET_STRING_ID 0x04
  50. #define DER_ENCODING_NULL_ID 0x05
  51. #define DER_ENCODING_OBJECT_ID 0x06
  52. #define DER_ENCODING_ENUMERATED_ID 0x0A
  53. #define DER_ENCODING_UTF8_ID 0x0C
  54. #define DER_ENCODING_PRINTABLE_STRING_ID 0x13
  55. #define DER_ENCODING_IA5_STRING_ID 0x16
  56. #define DER_ENCODING_UTC_TIME_ID 0x17
  57. #define DER_ENCODING_GENERALIZED_TIME_ID 0x18
  58. #define DER_ENCODING_SEQUENCE_ID 0x30
  59. #define DER_ENCODING_SET_ID 0x31
  60. #define X509_BIT0 128
  61. #define X509_BIT1 64
  62. #define X509_BIT2 32
  63. #define X509_BIT3 16
  64. #define X509_BIT4 8
  65. #define X509_BIT5 4
  66. #define X509_BIT6 2
  67. #define X509_BIT7 1
  68. #define MAX_SUPPORTED_VERSION 0x02
  69. #define MAX_HASH_LEN 20
  70. #define ECDSA_KEY_ELEMENT_SIZE 32 // applies for px and py
  71. #define ECDSA_KEY_SIZE 64
  72. #define IMPLICIT_TAG_ID 0x80
  73. #define EXPLICIT_TAG_ID 0xA0
  74. #define IMPLICIT_TAG_STRUCTURED_TYPE_ID 0xA0
  75. #define TAG_NUMBER_ISSUER_UNIQUE_ID 1
  76. #define TAG_NUMBER_SUBJECT_UNIQUE_ID 2
  77. #define TAG_NUMBER_EXTENSIONS 3
  78. #define TAG_NUMBER_AUTHORITY_KEY_ID 0
  79. #define TAG_NUMBER_AUTHORITY_CERT_ISSUER_ID 1
  80. #define TAG_NUMBER_AUTHORITY_CERT_SERIAL_NUMBER_ID 2
  81. #define DER_ENCODING_TRUE 0xFF
  82. #define DER_ENCODING_FALSE 0x00
  83. /* To supress thr warning on duplicate ECDSA_SIGANTURE_SIZE definition */
  84. #undef ECDSA_SIGNATURE_SIZE
  85. #define ECDSA_SIGNATURE_SIZE 64
  86. #define ECDSA_SIGNATURE_MAX_SIZE_R 32
  87. #define ECDSA_SIGNATURE_MAX_SIZE_S 32
  88. #define RSA_SIGNATURE_SIZE 256
  89. #define RSA_KEY_SIZE_2048_BYTES 256
  90. #define RSA_E_SIZE 4
  91. #define MAX_VERSION_LENGTH_SIZE_BYTES 4
  92. #define MAX_CERT_CHAIN_LENGTH 5
  93. #define SECONDS_IN_DAY 86400
  94. #define OCSP_DELAY_TOLERANCE_SECONDS 120
  95. typedef enum{
  96. v1 = 0,
  97. v2,
  98. v3,
  99. }CERTIFICATE_VERSIONS;
  100. /* CmlaOmaDataBuffer */
  101. typedef struct{
  102. Uint32 length;
  103. Uint8* buffer;
  104. } SessMgrDataBuffer;
  105. typedef enum{
  106. signature_algo,
  107. PublicKey_algo,
  108. Hash_algo
  109. }AlgorithmTypes;
  110. typedef X509SignAlgoType SessMgrSignAlgoType;
  111. typedef X509PublicKeyAlgoType SessMgrPublicKeyAlgoType;
  112. typedef enum{
  113. AuthorityKeyId = 0,
  114. SubjectKeyId,
  115. KeyUsage,
  116. BasicConstraint,
  117. CertificatePolicy,
  118. ExtendedKeyUsage,
  119. ProductType,
  120. Max_supported_CertExtensions
  121. }CertExtensions;
  122. typedef enum{
  123. Nonce = 0,
  124. Max_supported_OcspExtensions
  125. }OcspExtensions;
  126. /* name struct for issuer and subject */
  127. typedef enum{
  128. commonName = 0,
  129. organization,
  130. country,
  131. locality,
  132. state,
  133. organizationUnit,
  134. UserId,
  135. Max_NameId_Supported
  136. } NameStruct;
  137. /* name struct for issuer and subject */
  138. typedef struct{
  139. char *DistinguishedName;
  140. Uint32 DistinguishedNameSize;
  141. char* commonName; /* OID 2 5 4 3 */
  142. Uint32 commonNameSize;
  143. char* organization; /* OID 2 5 4 10 */
  144. Uint32 organizationSize;
  145. char* country; /* OID 2 5 4 6 */
  146. Uint32 countrySize;
  147. char* locality; /* OID 2 5 4 7 */
  148. Uint32 localitySize;
  149. char* state; /* OID 2 5 4 8 */
  150. Uint32 stateSize;
  151. char* organizationUnit; /* OID 2 5 4 11 */
  152. Uint32 organizationUnitSize;
  153. char* UserId; /* 0x09, 0x92, 0x26, 0x89, 0x93, 0xF2, 0x2C, 0x64, 0x01, 0x01 */
  154. Uint32 UserIdSize;
  155. } SessMgrX509Name;
  156. /* time */
  157. typedef union{
  158. Uint32 data;
  159. struct{
  160. Uint32 hour : 6; /* 0-23 */
  161. Uint32 minute : 6; /* 0-59 */
  162. Uint32 second : 6; /* 0-59 */
  163. Uint32 timezone_is_neg : 2;
  164. Uint32 timezone_hour : 6;
  165. Uint32 timezone_minute : 6;
  166. } hourMinuteSecond;
  167. } SessMgrTime;
  168. /* date */
  169. typedef union{
  170. Uint32 data;
  171. struct{
  172. Uint32 year : 16;/* 2000-2137 */
  173. Uint32 month : 4; /* 1-12 */
  174. Uint32 day : 6; /* 1-31 */
  175. Uint32 reserve : 6;
  176. } yearMonthDay;
  177. } SessMgrDate;
  178. typedef struct{
  179. SessMgrTime time;
  180. SessMgrDate date;
  181. } SessMgrDateTime;
  182. /*
  183. This enum is used so that caller can pass this argument to the ParseCertificateChain function. Based on this, we can do extra validation on each
  184. certificate
  185. */
  186. typedef enum{
  187. EpidGroupCertificate = 0,
  188. VerifierCertificate,
  189. OcspResponderCertificate,
  190. Others, // OMA DRM
  191. }CertificateType;
  192. typedef enum{
  193. root = 0,
  194. intermediate,
  195. leaf,
  196. }CertificateLevel;
  197. typedef enum{
  198. /* OID 1 2 840 10045 3 1 1 7 */
  199. curvePrime256v1 = 0,
  200. MaxElipticCurveOidSupported,
  201. unknownParameter = MaxElipticCurveOidSupported,
  202. } SessMgrEllipticCurveParameter;
  203. /* Definition of ECDSA public key */
  204. typedef struct{
  205. Uint8* px; /* always 32 bytes */
  206. Uint8* py; /* always 32 bytes */
  207. SessMgrEllipticCurveParameter eccParameter;
  208. } SessMgrEcdsaPublicKey;
  209. /* Definition of RSA key */
  210. typedef struct{
  211. SessMgrDataBuffer n;
  212. SessMgrDataBuffer p;
  213. SessMgrDataBuffer e;
  214. } SessMgrRsaKey;
  215. /* Definition of EPID group public key */
  216. typedef struct{
  217. Uint32 groupId;
  218. Uint8* h1x; /* always 32 bytes */
  219. Uint8* h1y; /* always 32 bytes */
  220. Uint8* h2x; /* always 32 bytes */
  221. Uint8* h2y; /* always 32 bytes */
  222. Uint8* wx0; /* always 32 bytes */
  223. Uint8* wx1; /* always 32 bytes */
  224. Uint8* wx2; /* always 32 bytes */
  225. Uint8* wy0; /* always 32 bytes */
  226. Uint8* wy1; /* always 32 bytes */
  227. Uint8* wy2; /* always 32 bytes */
  228. } SessMgrEpidGroupPublicKey;
  229. /* SessMgrKeyUsage */
  230. typedef union {
  231. Uint32 value;
  232. struct {
  233. Uint32 OCSPSign : 1;
  234. Uint32 reserved : 31;
  235. } usage;
  236. } SessMgrExtendedKeyUsage;
  237. /* SessMgrKeyUsage */
  238. typedef union {
  239. Uint16 value;
  240. struct {
  241. Uint16 digitalSignature: 1;
  242. Uint16 nonRepudiation: 1;
  243. Uint16 keyEncipherment: 1;
  244. Uint16 dataEncipherment: 1;
  245. Uint16 keyAgreement: 1;
  246. Uint16 keyCertSign: 1;
  247. Uint16 cRLSign: 1;
  248. Uint16 encipherOnly: 1;
  249. Uint16 decipherOnly: 1;
  250. Uint16 reserved: 7;
  251. } usage;
  252. } SessMgrKeyUsage;
  253. typedef struct _RsaPublicKey
  254. {
  255. /**
  256. * @brief Buffer for Key.e
  257. */
  258. UINT8 Ebuffer[RSA_E_SIZE];
  259. /**
  260. * @brief Buffer for Key.n
  261. */
  262. UINT8 Nbuffer[RSA_KEY_SIZE_2048_BYTES];
  263. } RsaPublicKey;
  264. typedef struct _PseEcdsaPublicKey
  265. {
  266. /**
  267. * @brief Buffer for px
  268. */
  269. UINT8 px[32];
  270. /**
  271. * @brief Buffer for py
  272. */
  273. UINT8 py[32];
  274. }PseEcdsaPublicKey;
  275. /* SessMgrProductType */
  276. typedef enum{
  277. reserved = 0,
  278. invalidProductType = reserved,
  279. mediaVault,
  280. identityProtectionTechnology,
  281. capabilityLicensingServices,
  282. intelDAtestCertificate,
  283. Max_ProductType
  284. } SessMgrProductType;
  285. /* SessMgrCertificatePolicy */
  286. typedef enum{
  287. intel_sigma_cert_policy = 0,
  288. Max_Certificatepolicy
  289. } SessMgrCertificatePolicyId;
  290. /* SessMgrCertificatePolicyQualifierId */
  291. typedef enum{
  292. internet_policy_qualifier = 0,
  293. Max_CertificatepolicyQualifierid
  294. } SessMgrCertificatePolicyQualifierId;
  295. /* SessMgrBasicConstraint */
  296. typedef struct{
  297. BOOL isBasicConstraintPresent;
  298. BOOL isCa; /* is subject a CA? */
  299. Uint32 pathLenConstraint; /* applicable only if isCa is TRUE */
  300. } SessMgrBasicConstraint;
  301. /* information extracted from certificate */
  302. /* !!!! if you change this, you MUST change the corresponding stucture in container.h !!!!*/
  303. typedef struct{
  304. Uint32 certificateVersion;
  305. SessMgrDataBuffer serialNumber;
  306. SessMgrPublicKeyAlgoType algorithmIdentifierForSubjectPublicKey;
  307. SessMgrSignAlgoType algorithmIdentifierForSignature;
  308. SessMgrX509Name issuer;
  309. SessMgrX509Name subject;
  310. SessMgrDateTime notValidBeforeTime;
  311. SessMgrDateTime notValidAfterTime;
  312. SessMgrDataBuffer subjectPublicKey;
  313. SessMgrDataBuffer EncodedSubjectPublicKey; // ptr to the encoding. This will be used to calculate the hash.
  314. SessMgrDataBuffer IssuerUniqueId;
  315. SessMgrDataBuffer SubjectUniqueId;
  316. SessMgrDataBuffer AuthorityKeyId;
  317. SessMgrDataBuffer SubjectKeyId;
  318. SessMgrKeyUsage keyUsage; /* not applicable to group cert */
  319. SessMgrExtendedKeyUsage ExtendedKeyUsage;
  320. SessMgrProductType productType; /* only applicable to Intel-signed cert OID 1 2 840 113741 1 9 2 */
  321. SessMgrDataBuffer CertificatePolicy;
  322. SessMgrBasicConstraint basicConstraint; /* only applicable to OCSP responder cert */
  323. SessMgrSignAlgoType TbsCertSignAlgoId;
  324. SessMgrDataBuffer signatureBuffer;
  325. SessMgrDataBuffer messageBuffer; /* aka tbsCertificate. everything that is signed */
  326. } SessMgrCertificateFields;
  327. /*
  328. The ISSUER_INFO is a data structure that is used to store interesting information about the issuer of the certificate. Because in a chain, the current certificate is the issuer
  329. of the next certificate in the chain, In most cases, this data structure will contain data (like public key, signature algo, hash etc) of the parent.
  330. For the root certificate, we have to calculate the hash of the issuer's public key from the hard coded value. The Hash of the key will be compared against the IssuerKeyHash in the OCSP response.
  331. */
  332. typedef struct{
  333. Uint32 length;
  334. Uint8* buffer;
  335. SessMgrSignAlgoType AlgoType;
  336. SessMgrDataBuffer EncodedPublicKeyHashBuffer;
  337. SessMgrDataBuffer CommonNameBuf;
  338. SessMgrProductType productType;
  339. } ISSUER_INFO;
  340. typedef enum{
  341. EXPLICIT_TAG_0_ID_VALUE = 0xa0,
  342. }DER_EXPLICIT_TAG_ID;
  343. typedef enum{
  344. X509_STATUS_SUCCESS = 0,
  345. X509_GENERAL_ERROR,
  346. X509_STATUS_INVALID_VERSION,
  347. X509_STATUS_UNSUPPORTED_ALGORITHM,
  348. X509_STATUS_ENCODING_ERROR,
  349. X509_STATUS_INVALID_ARGS,
  350. X509_STATUS_UNSUPPORTED_CRITICAL_EXTENSION,
  351. X509_STATUS_UNSUPPORTED_TYPE,
  352. X509_STATUS_OCSP_FAILURE,
  353. X509_INVALID_SIGNATURE,
  354. X509_STATUS_UNKNOWN_OID,
  355. X509_STATUS_NOT_FOUND,
  356. X509_STATUS_OCSP_VERIFICATION_FAILED,
  357. X509_STATUS_UNSUPPORTED_PARAMETER,
  358. X509_STATUS_EXPIRED_CERTIFICATE,
  359. X509_STATUS_INTERNAL_ERROR,
  360. X509_STATUS_BASIC_CONSTRAINTS_VIOLATION,
  361. X509_STATUS_MEMORY_ALLOCATION_ERROR,
  362. X509_STATUS_INVALID_PARAMS,
  363. }X509_Parser_Error_codes;
  364. typedef enum{
  365. explicit_tag = 0,
  366. implicit_tag,
  367. invalid_tag,
  368. }TAG_TYPE;
  369. /* only supports SHA1 and SHA256 */
  370. typedef enum{
  371. sessMgrHashSha1 = 0,
  372. sessMgrHashSha256
  373. } SessMgrHashTypes;
  374. typedef struct _OCSP_CERT_STATUS_TABLE{
  375. UINT8 serialNumber[20];
  376. UINT8 SerialNumberSize;
  377. SessMgrHashTypes HashAlgo;
  378. UINT8 issuerKeyHash[20];
  379. UINT8 issuerKeyHashSize;
  380. UINT8 issuerNameHash[20];
  381. UINT8 issuerNameHashSize;
  382. }OCSP_CERT_STATUS_TABLE;
  383. /* Macros */
  384. #define CHECK_ID(value, ExpectedId) { if(value != ExpectedId) { \
  385. DBG_ASSERT(0); \
  386. return X509_STATUS_ENCODING_ERROR; \
  387. } }
  388. #define CHECK_VALUE(value, ExpectedValue) { if(value != ExpectedValue) { \
  389. DBG_ASSERT(0); \
  390. return X509_STATUS_ENCODING_ERROR; \
  391. } }
  392. #define CHECK_ID_OPTIONAL(value, ExpectedId) (value == ExpectedId)
  393. #define FIND_TAG_TYPE(ptr, TagId, TagType) \
  394. { if(((*ptr & 0xF0) == 0xA0) && ((*ptr & 0x0F) == TagId)) \
  395. TagType = explicit_tag; \
  396. else if (((*ptr & 0xF0) == 0x80) && ((*ptr & 0x0F) == TagId)) \
  397. TagType = implicit_tag; \
  398. else \
  399. TagType = invalid_tag; }
  400. //STATUS ParseTime(UINT8 **ppCurrent, UINT8 *pEnd, SessMgrDateTime* DataTime);
  401. //STATUS ParseName(UINT8 **ppCurrent, UINT8 *pEnd, SessMgrX509Name* Name);
  402. //STATUS ParseAlgoIdentifier(UINT8 **ppCurrent, UINT8 *pEnd, UINT32* algoId, AlgorithmTypes Type, SessMgrEllipticCurveParameter* params);
  403. //STATUS ParseOID(UINT8 **ppCurrent, UINT8 *pEnd, UINT32 *EnumVal, const UINT8 *OidList, UINT32 Max_Entries, UINT32 EntrySize);
  404. //STATUS ParseAlgoParameters(UINT8 **ppCurrent, UINT8 *pEnd, UINT32 *param);
  405. //STATUS ParseSubjectPublicKeyInfo(UINT8 **ppCurrent, UINT8 *pEnd, UINT8 **pworkbuffer, SessMgrCertificateFields* certificateFields);
  406. //STATUS ParseEcdsaPublicKey(UINT8 **ppCurrent, UINT8 *pEnd, SessMgrEcdsaPublicKey * EcDsaKey, SessMgrEllipticCurveParameter params);
  407. //STATUS ParseEpidPublicKey(UINT8 **ppCurrent, UINT8 *pEnd, SessMgrEpidGroupPublicKey * EpidKey);
  408. //STATUS ParseCertExtensions(UINT8 **ppCurrent, UINT8 *pEnd, SessMgrCertificateFields* certificateFields);
  409. //STATUS ParseCertificatePolicy(UINT8 **ppCurrent, UINT8 *pEnd, SessMgrDataBuffer *CertificatePolicy);
  410. //STATUS ParseSignatureValue(UINT8 **ppCurrent, UINT8 *pEnd, UINT8 **pworkbuffer, UINT32 WorkBufferSize, SessMgrDataBuffer *SignatureValueBuf, UINT8 SignatureAlgoId);
  411. //STATUS ParseRsaPublicKey(UINT8 **ppCurrent, UINT8 *pEnd, SessMgrRsaKey * RsaKey);
  412. //STATUS ParseInteger(UINT8 **ppCurrent, UINT8 *pEnd, SessMgrDataBuffer* DataBuf, BOOL isOptional, BOOL MustBePositive, UINT32 *PaddingLen);
  413. //STATUS ParseIdAndLength(UINT8 **ppCurrent, UINT8 *pEnd, UINT8 ExpectedId, UINT32* Length, UINT8* EncodingBytes, BOOL Optional);
  414. //STATUS ParseBoolean(UINT8 **ppCurrent, UINT8 *pEnd, BOOL* Value, BOOL optional);
  415. //STATUS sessMgrParseDerCert
  416. //(
  417. // IN X509_PROTOCOL* X509Protocol,
  418. // IN Uint8* certificateDerEncoded,
  419. // IN UINT8* pCertificateEnd,
  420. // IN Uint8* workBuffer,
  421. // IN UINT32 workBufferSize,
  422. // OUT SessMgrCertificateFields* certificateFields,
  423. // IN ISSUER_INFO *IssuerInfo,
  424. // IN BOOL UseFacsimileEpid
  425. // );
  426. void PrintName(SessMgrX509Name *Name);
  427. void PrintValidity(SessMgrDateTime *Time);
  428. void PrintEcdsaPublicKey(SessMgrEcdsaPublicKey *Key);
  429. void PrintAlgo(UINT8 *AlgoId);
  430. void PrintDataBuffer(SessMgrDataBuffer *data);
  431. void PrintEpidKey(SessMgrEpidGroupPublicKey *Key);
  432. STATUS ParseCertificateChain(UINT8 *pCertChain,
  433. UINT32 CertChainLength,
  434. SessMgrCertificateFields *certificateFields,
  435. UINT8 *CertWorkBuffer,
  436. UINT32 CertWorkBufferLength,
  437. ISSUER_INFO *RootPublicKey,
  438. UINT8 NumberOfSingleResponses,
  439. OCSP_CERT_STATUS_TABLE *OcspCertStatusTable,
  440. CertificateType CertType,
  441. BOOL UseFacsimileEpid);
  442. //STATUS ParseOcspResponseChain(UINT8* OcspRespBuffer,
  443. // UINT32 OcspRespBufferLength,
  444. // UINT8* workBuffer,
  445. // UINT32 workBufferSize,
  446. // ISSUER_INFO* OcspCertRootPublicKey,
  447. // OCSP_CERT_STATUS_TABLE *OcspCertStatusTable,
  448. // UINT8* NumberOfSingleResponses,
  449. // SessMgrDataBuffer Nonce,
  450. // OCSP_REQ_TYPE OcspReqType,
  451. // BOOL UseFacsimileEpid);
  452. //STATUS DecodeLength(UINT8* Buffer, UINT8* BufferEnd, UINT32* Length, UINT8* EncodingBytes);
  453. //UINT32 DecodeTime(UINT8 *current_ptr, UINT8 length);
  454. //void SwapEndian(UINT8* Ptr, int length);
  455. //int Pow(int num, int exp);
  456. //STATUS swapendian_memcpy(UINT8 *DestPtr, UINT32 DestLen, UINT8 *SrcPtr, UINT32 SrcLen);
  457. //BOOL VerifySha1Hash(SessMgrDataBuffer *HashData, UINT8 *Expectedhash, UINT32 ExpectedHashLength);
  458. #endif