This commit is contained in:
Ben Laurie 2001-09-26 15:14:10 +00:00
parent 89eeccacde
commit dbeac560aa

View File

@ -62,6 +62,8 @@ static void *dummy=&dummy;
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <unistd.h>
#include <assert.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <crypto/cryptodev.h> #include <crypto/cryptodev.h>
#include <openssl/engine.h> #include <openssl/engine.h>
@ -78,8 +80,8 @@ static int dev_crypto_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
static int dev_crypto_digests(ENGINE *e, const EVP_MD **digest, static int dev_crypto_digests(ENGINE *e, const EVP_MD **digest,
const int **nids, int nid); const int **nids, int nid);
static const char *dev_crypto_id = "openbsd_dev_crypto"; static const char dev_crypto_id[] = "openbsd_dev_crypto";
static const char *dev_crypto_name = "OpenBSD /dev/crypto"; static const char dev_crypto_name[] = "OpenBSD /dev/crypto";
static ENGINE *engine_openbsd_dev_crypto(void) static ENGINE *engine_openbsd_dev_crypto(void)
{ {
@ -176,6 +178,7 @@ static int dev_crypto_init(session_op *ses)
static int dev_crypto_cleanup(EVP_CIPHER_CTX *ctx) static int dev_crypto_cleanup(EVP_CIPHER_CTX *ctx)
{ {
fprintf(stderr,"cleanup %d\n",CDATA(ctx)->ses);
if(ioctl(fd,CIOCFSESSION,&CDATA(ctx)->ses) == -1) if(ioctl(fd,CIOCFSESSION,&CDATA(ctx)->ses) == -1)
err("CIOCFSESSION failed"); err("CIOCFSESSION failed");
@ -325,11 +328,13 @@ static int dev_crypto_init_digest(MD_DATA *md_data,int mac)
err("CIOCGSESSION failed"); err("CIOCGSESSION failed");
return 0; return 0;
} }
fprintf(stderr,"opened %d\n",md_data->sess.ses);
return 1; return 1;
} }
static int dev_crypto_cleanup_digest(MD_DATA *md_data) static int dev_crypto_cleanup_digest(MD_DATA *md_data)
{ {
fprintf(stderr,"cleanup %d\n",md_data->sess.ses);
if (ioctl(fd,CIOCFSESSION,&md_data->sess.ses) == -1) if (ioctl(fd,CIOCFSESSION,&md_data->sess.ses) == -1)
{ {
err("CIOCFSESSION failed"); err("CIOCFSESSION failed");