Skip to content

Commit

Permalink
Added a few more PKCS#11 callback functions, that all fail for now.
Browse files Browse the repository at this point in the history
Functions:
  InitToken
  InitPIN
  SetPIN
  CloseAllSessions

Bug #14.
  • Loading branch information
ThomasHabets committed Oct 29, 2014
1 parent 98c94f1 commit db131e2
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/pk11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,43 @@ C_Initialize(CK_VOID_PTR pInitArgs)
return wrap_exceptions(__func__, [&]{});
}

CK_RV
C_InitToken(CK_SLOT_ID slot_id, unsigned char *pin,
unsigned long pin_len, unsigned char *label)
{
return wrap_exceptions(__func__, [&]{
throw PK11Error(CKR_GENERAL_ERROR, "Not implemented.");
});
}

CK_RV
C_InitPIN(CK_SESSION_HANDLE session, unsigned char *pin,
unsigned long pin_len)
{
return wrap_exceptions(__func__, [&]{
throw PK11Error(CKR_GENERAL_ERROR, "Not implemented.");
});
}

CK_RV
C_SetPIN(CK_SESSION_HANDLE session, unsigned char *old_pin,
unsigned long old_len, unsigned char *new_pin,
unsigned long new_len)
{
return wrap_exceptions(__func__, [&]{
throw PK11Error(CKR_GENERAL_ERROR, "Not implemented.");
});
}

CK_RV
C_CloseAllSessions(CK_SLOT_ID slot_id)
{
return wrap_exceptions(__func__, [&]{
throw PK11Error(CKR_GENERAL_ERROR, "Not implemented.");
});
}


CK_RV
C_SeedRandom(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pSeed, CK_ULONG ulSeedLen)
{
Expand All @@ -387,6 +424,9 @@ void cons()
#define F(x) funclist.C_##x = C_##x
F(GetInfo);
F(Initialize);
F(InitToken);
F(InitPIN);
F(SetPIN);
F(Finalize);
F(GetSlotList);
F(GetSlotInfo);
Expand All @@ -395,12 +435,16 @@ void cons()
F(GetMechanismInfo);
F(Login);
F(Logout);

F(OpenSession);
F(CloseSession);
F(CloseAllSessions);
F(GetSessionInfo);

F(FindObjectsInit);
F(FindObjects);
F(FindObjectsFinal);

F(GetAttributeValue);
F(SignInit);
F(Sign);
Expand Down

0 comments on commit db131e2

Please sign in to comment.