/[openpgpmdrv]/trunk/OpenPGPminidriver/ContextManagement.c
ViewVC logotype

Diff of /trunk/OpenPGPminidriver/ContextManagement.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 8 by vletoux, Thu Mar 11 20:32:26 2010 UTC revision 9 by vletoux, Mon Mar 15 09:47:30 2010 UTC
# Line 21  Line 21 
21  #include "Context.h"  #include "Context.h"
22  #include "Smartcard.h"  #include "Smartcard.h"
23  #include "PublicDataOperations.h"  #include "PublicDataOperations.h"
24    #include "CryptoOperations.h"
25    
26  SCARD_ATRMASK SupportedATR [] =  SCARD_ATRMASK SupportedATR [] =
27  {  {
# Line 237  DWORD CreateContext(__in PCARD_DATA pCar Line 238  DWORD CreateContext(__in PCARD_DATA pCar
238                                                          dwApplicationIdentifierSize,                                                          dwApplicationIdentifierSize,
239                                                          dwExtendedCapabilitiesSize,                                                          dwExtendedCapabilitiesSize,
240                                                          dwFingerPrintSize;                                                          dwFingerPrintSize;
241          DWORD dwI;          DWORD dwI, dwJ;
242          BYTE bCategoryIndicator, bStatusIndicator;          BYTE bCategoryIndicator, bStatusIndicator;
243          POPENPGP_CONTEXT pContext;          POPENPGP_CONTEXT pContext;
244          __try          __try
# Line 348  DWORD CreateContext(__in PCARD_DATA pCar Line 349  DWORD CreateContext(__in PCARD_DATA pCar
349                          dwReturn = SCARD_E_UNEXPECTED;                          dwReturn = SCARD_E_UNEXPECTED;
350                          __leave;                          __leave;
351                  }                  }
352                  pContext->fHasSignature = FALSE;                  memcpy(pContext->bFingerPrint, pbFingerPrint, 60);
353                  for( dwI = 0; dwI < 20; dwI++)                  for(dwJ = 0; dwJ < KeyMax; dwJ++)
                 {  
                         if (pbFingerPrint[dwI] != 0)  
                         {  
                                 pContext->fHasSignature = TRUE;  
                                 break;  
                         }  
                 }  
                 pContext->fHasDecryption = FALSE;  
                 for( dwI = 20; dwI < 40; dwI++)  
                 {  
                         if (pbFingerPrint[dwI] != 0)  
                         {  
                                 pContext->fHasDecryption = TRUE;  
                                 break;  
                         }  
                 }  
                 pContext->fHasAuthentication = FALSE;  
                 for( dwI = 40; dwI < 60; dwI++)  
354                  {                  {
355                          if (pbFingerPrint[dwI] != 0)                          pContext->fHasKey[dwJ] = FALSE;
356                            for( dwI = dwJ * 20; dwI < dwJ * 20 + 20; dwI++)
357                          {                          {
358                                  pContext->fHasAuthentication = TRUE;                                  if (pbFingerPrint[dwI] != 0)
359                                  break;                                  {
360                                            pContext->fHasKey[dwJ] = TRUE;
361                                            break;
362                                    }
363                          }                          }
364                  }                  }
365                  dwReturn = CCIDgetFeatures(pCardData);                  dwReturn = CCIDgetFeatures(pCardData);

Legend:
Removed from v.8  
changed lines
  Added in v.9

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26