MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / GetDateOfTimeStamp

Function GetDateOfTimeStamp

libipc/common_name.cpp:482–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480}
481
482BOOL GetDateOfTimeStamp(PCMSG_SIGNER_INFO pSignerInfo, SYSTEMTIME* st)
483{
484 BOOL fResult;
485 FILETIME lft, ft;
486 DWORD dwData;
487 BOOL fReturn = FALSE;
488
489 // Loop through authenticated attributes and find
490 // szOID_RSA_signingTime OID.
491 for (DWORD n = 0; n < pSignerInfo->AuthAttrs.cAttr; n++)
492 {
493 if (lstrcmpA(szOID_RSA_signingTime,
494 pSignerInfo->AuthAttrs.rgAttr[n].pszObjId) == 0)
495 {
496 // Decode and get FILETIME structure.
497 dwData = sizeof(ft);
498 fResult = CryptDecodeObject(ENCODING,
499 szOID_RSA_signingTime,
500 pSignerInfo->AuthAttrs.rgAttr[n].rgValue[0].pbData,
501 pSignerInfo->AuthAttrs.rgAttr[n].rgValue[0].cbData,
502 0,
503 (PVOID)&ft,
504 &dwData);
505 if (!fResult)
506 {
507 //_tprintf(_T("CryptDecodeObject failed with %x\n"),
508 // GetLastError());
509 break;
510 }
511
512 // Convert to local time.
513 FileTimeToLocalFileTime(&ft, &lft);
514 FileTimeToSystemTime(&lft, st);
515
516 fReturn = TRUE;
517
518 break; // Break from for loop.
519
520 } //lstrcmp szOID_RSA_signingTime
521 } // for
522
523 return fReturn;
524}
525
526BOOL GetTimeStampSignerInfo(PCMSG_SIGNER_INFO pSignerInfo, PCMSG_SIGNER_INFO* pCounterSignerInfo)
527{

Callers 1

GetCommonNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected