compiled on mac
This commit is contained in:
2
COPYING
2
COPYING
@@ -1 +1 @@
|
||||
/usr/share/automake-1.11/COPYING
|
||||
/opt/local/share/automake-1.11/COPYING
|
2
INSTALL
2
INSTALL
@@ -1 +1 @@
|
||||
/usr/share/automake-1.11/INSTALL
|
||||
/opt/local/share/automake-1.11/INSTALL
|
@@ -21,9 +21,6 @@ typedef CK_RV (*CK_C_GetFunctionList)
|
||||
#undef ERROR
|
||||
#endif
|
||||
|
||||
// no logging
|
||||
#define CRYPTOKI_LOG(X)
|
||||
|
||||
namespace cryptoki {
|
||||
|
||||
bool Init::functionList(const std::string& library) {
|
||||
|
@@ -992,6 +992,10 @@ namespace cryptoki {
|
||||
friend class Login;
|
||||
friend class Object;
|
||||
|
||||
CK_FUNCTION_LIST* fn() {
|
||||
return _slot._init->_fn;
|
||||
}
|
||||
|
||||
Slot& _slot;
|
||||
CK_SESSION_HANDLE _session;
|
||||
CK_RV _res;
|
||||
@@ -1268,7 +1272,7 @@ namespace cryptoki {
|
||||
CK_USER_TYPE userType=CKU_USER): _session(session) {
|
||||
CRYPTOKI_LOG("log");
|
||||
//! calls @c C_Login
|
||||
_session.check(_session._slot._init->_fn->C_Login
|
||||
_session.check(_session.fn()->C_Login
|
||||
(_session._session, userType,
|
||||
(CK_CHAR*)pin.c_str(),
|
||||
pin.size()),
|
||||
@@ -1278,7 +1282,7 @@ namespace cryptoki {
|
||||
~Login() {
|
||||
try {
|
||||
//! calls @c C_Logout
|
||||
_session.check(_session._slot._init->_fn->C_Logout
|
||||
_session.check(_session.fn()->C_Logout
|
||||
(_session._session),
|
||||
CRYPTOKI_FN_LOG("C_Logout"));
|
||||
} catch (...) {
|
||||
|
@@ -697,7 +697,7 @@ namespace openssl {
|
||||
rsa(o);
|
||||
dsa(o);
|
||||
dh(o);
|
||||
ec(o);
|
||||
/*ec(o);*/
|
||||
}
|
||||
std::string string(BIGNUM* a) const {
|
||||
std::string res(BN_num_bytes(a), '0');
|
||||
@@ -717,10 +717,12 @@ namespace openssl {
|
||||
DH* tmp(o.dh());
|
||||
if (tmp&&!EVP_PKEY_set1_DH(_key, tmp)) throw key_copy_failed();
|
||||
}
|
||||
/* Not available on mac osx
|
||||
void ec(const PrivateKey& o) {
|
||||
EC_KEY* tmp(o.ec());
|
||||
if (tmp&&!EVP_PKEY_set1_EC_KEY(_key, tmp)) throw key_copy_failed();
|
||||
}
|
||||
*/
|
||||
RSA* rsa() const {
|
||||
//! @todo throw exception if 0?
|
||||
return EVP_PKEY_get1_RSA(_key);
|
||||
@@ -731,9 +733,10 @@ namespace openssl {
|
||||
DH* dh() const {
|
||||
return EVP_PKEY_get1_DH(_key);
|
||||
}
|
||||
/* Not available on mac osx
|
||||
EC_KEY* ec() const {
|
||||
return EVP_PKEY_get1_EC_KEY(_key);
|
||||
}
|
||||
}*/
|
||||
EVP_PKEY* _key;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user