Commit b87b7754 authored by Alberto Inch's avatar Alberto Inch
Browse files

Close session after to init token.

parent 89be7144
......@@ -89,12 +89,16 @@ void Token::unlock(CK_SESSION_HANDLE hSession, const char* soPin, const char* ne
}
}
void Token::init(CK_SLOT_ID slot, const char* soPin) {
CK_SESSION_HANDLE Token::init(CK_SLOT_ID slot, const char* soPin) {
char soBuf[21];
strcpy(soBuf, soPin);
soPin = soBuf;
CK_RV rv = functionList->C_InitToken(slot, (CK_UTF8CHAR *)soBuf, strlen(soBuf), (unsigned char*)"ePass2003");
error(rv);
CK_SESSION_HANDLE hSession = open(slot);
rv = functionList->C_Logout(hSession);
error(rv);
return hSession;
}
char* Token::byteToHex(CK_BYTE_PTR bytes, int l) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment