- Win32 fixes in case openssl is not present (Stef)

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@842 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
okir 2003-01-06 19:52:11 +00:00
parent 144bb23a7c
commit 67608feffb
3 changed files with 9 additions and 4 deletions

View File

@ -10,7 +10,8 @@ TARGET = opensc-pkcs11.dll
TARGET2 = libpkcs11.lib
OBJECTS = pkcs11-global.obj pkcs11-session.obj pkcs11-object.obj misc.obj slot.obj \
secretkey.obj framework-pkcs15.obj framework-pkcs15init.obj mechanism.obj
secretkey.obj framework-pkcs15.obj framework-pkcs15init.obj mechanism.obj \
openssl.obj
OBJECTS2 = libpkcs11.obj
all: install-headers install-headers-dir $(TARGET) $(TARGET2)

View File

@ -6,9 +6,9 @@
*/
#include "sc-pkcs11.h"
#include <openssl/evp.h>
#ifdef HAVE_OPENSSL
#include <openssl/evp.h>
static CK_RV sc_pkcs11_openssl_md_init(sc_pkcs11_operation_t *);
static CK_RV sc_pkcs11_openssl_md_update(sc_pkcs11_operation_t *,

View File

@ -979,10 +979,12 @@ test_signature(CK_SLOT_ID slot, CK_SESSION_HANDLE session)
unsigned char sig1[1024], sig2[1024];
CK_ULONG sigLen1, sigLen2;
#ifdef HAVE_OPENSSL
int err;
X509 *x509;
EVP_PKEY *pkey;
EVP_MD_CTX md_ctx;
#endif
CK_MECHANISM_TYPE mechTypes[] = {
CKM_RSA_X_509,
@ -1012,6 +1014,7 @@ test_signature(CK_SLOT_ID slot, CK_SESSION_HANDLE session)
sizeof(verifyData),
sizeof(verifyData),
};
#ifdef HAVE_OPENSSL
EVP_MD *evp_mds[] = {
EVP_sha1(),
EVP_sha1(),
@ -1019,6 +1022,7 @@ test_signature(CK_SLOT_ID slot, CK_SESSION_HANDLE session)
EVP_md5(),
EVP_ripemd160(),
};
#endif
rv = p11->C_GetSessionInfo(session, &sessionInfo);
if (rv == CKR_SESSION_HANDLE_INVALID) {
@ -1158,7 +1162,7 @@ test_signature(CK_SLOT_ID slot, CK_SESSION_HANDLE session)
rv = p11->C_SignInit(session, &ck_mech, privKeyObject);
/* mechanism not implemented, don't test */
if (rv == CKR_FUNCTION_NOT_SUPPORTED)
if (rv == CKR_MECHANISM_INVALID)
continue;
if (rv != CKR_OK)
p11_fatal("C_SignInit", rv);
@ -1176,7 +1180,7 @@ test_signature(CK_SLOT_ID slot, CK_SESSION_HANDLE session)
printf(" ERR: wrong signature length: %ld instead of %ld\n", sigLen1, modLenBytes);
}
#ifndef HAVE_OPENSSL
printf("unable to verify signature (compile with \DHAVE_OPENSSL)\n");
printf("unable to verify signature (compile with HAVE_OPENSSL)\n");
#else
id = NULL;
id = getID(session, privKeyObject, &idLen);