52 |
dwReturn = SCARD_E_INVALID_PARAMETER; |
dwReturn = SCARD_E_INVALID_PARAMETER; |
53 |
__leave; |
__leave; |
54 |
} |
} |
55 |
dwReturn = CreateContext(pCardData); |
dwReturn = CreateContext(pCardData, dwFlags); |
56 |
if (dwReturn) |
if (dwReturn) |
57 |
{ |
{ |
58 |
__leave; |
__leave; |
59 |
} |
} |
|
if (!(dwFlags & CARD_SECURE_KEY_INJECTION_NO_CARD_MODE)) |
|
|
{ |
|
|
if (pCardData->hSCardCtx == 0) |
|
|
{ |
|
|
Trace(WINEVENT_LEVEL_ERROR, L"pCardData->hSCardCtx == NULL"); |
|
|
dwReturn = SCARD_E_INVALID_PARAMETER; |
|
|
__leave; |
|
|
} |
|
|
if (pCardData->hScard == 0) |
|
|
{ |
|
|
Trace(WINEVENT_LEVEL_ERROR, L"pCardData->hScard == NULL"); |
|
|
dwReturn = SCARD_E_INVALID_PARAMETER; |
|
|
__leave; |
|
|
} |
|
|
} |
|
60 |
|
|
|
dwReturn = CheckContext(pCardData); |
|
|
if (dwReturn) |
|
|
{ |
|
|
__leave; |
|
|
} |
|
|
// select the application on the card |
|
|
dwReturn = SelectOpenPGPApplication(pCardData); |
|
|
if (dwReturn) |
|
|
{ |
|
|
__leave; |
|
|
} |
|
61 |
|
|
62 |
/* CardInitializationAndDeconstruct.c */ |
/* CardInitializationAndDeconstruct.c */ |
63 |
pCardData->pfnCardDeleteContext = CardDeleteContext; |
pCardData->pfnCardDeleteContext = CardDeleteContext; |
66 |
pCardData->pfnCardAuthenticatePin = CardAuthenticatePin; |
pCardData->pfnCardAuthenticatePin = CardAuthenticatePin; |
67 |
pCardData->pfnCardGetChallenge = CardGetChallenge; |
pCardData->pfnCardGetChallenge = CardGetChallenge; |
68 |
pCardData->pfnCardAuthenticateChallenge = CardAuthenticateChallenge; |
pCardData->pfnCardAuthenticateChallenge = CardAuthenticateChallenge; |
69 |
// CardDeauthenticate not implemented |
|
70 |
pCardData->pfnCardDeauthenticate = CardDeauthenticate; |
pCardData->pfnCardDeauthenticate = CardDeauthenticate; |
71 |
pCardData->pfnCardAuthenticateEx = CardAuthenticateEx; |
pCardData->pfnCardAuthenticateEx = CardAuthenticateEx; |
72 |
pCardData->pfnCardGetChallengeEx = CardGetChallengeEx; |
pCardData->pfnCardGetChallengeEx = CardGetChallengeEx; |
144 |
__inout PCARD_DATA pCardData |
__inout PCARD_DATA pCardData |
145 |
) |
) |
146 |
{ |
{ |
147 |
|
DWORD dwReturn; |
148 |
Trace(WINEVENT_LEVEL_VERBOSE, L"Enter"); |
Trace(WINEVENT_LEVEL_VERBOSE, L"Enter"); |
149 |
CleanContext(pCardData); |
dwReturn = CleanContext(pCardData); |
150 |
return 0; |
Trace(WINEVENT_LEVEL_VERBOSE, L"dwReturn = 0x%08X",dwReturn); |
151 |
|
return dwReturn; |
152 |
} |
} |