Deleted Added
full compact
cryptosoft.c (116191) cryptosoft.c (116924)
1/* $OpenBSD: cryptosoft.c,v 1.35 2002/04/26 08:43:50 deraadt Exp $ */
2
3/*
4 * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
5 *
6 * This code was written by Angelos D. Keromytis in Athens, Greece, in
7 * February 2000. Network Security Technologies Inc. (NSTI) kindly
8 * supported the development of this code.

--- 8 unchanged lines hidden (view full) ---

17 * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
18 * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
19 * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
20 * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
21 * PURPOSE.
22 */
23
24#include <sys/cdefs.h>
1/* $OpenBSD: cryptosoft.c,v 1.35 2002/04/26 08:43:50 deraadt Exp $ */
2
3/*
4 * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
5 *
6 * This code was written by Angelos D. Keromytis in Athens, Greece, in
7 * February 2000. Network Security Technologies Inc. (NSTI) kindly
8 * supported the development of this code.

--- 8 unchanged lines hidden (view full) ---

17 * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
18 * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
19 * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
20 * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
21 * PURPOSE.
22 */
23
24#include <sys/cdefs.h>
25__FBSDID("$FreeBSD: head/sys/opencrypto/cryptosoft.c 116191 2003-06-11 05:57:50Z obrien $");
25__FBSDID("$FreeBSD: head/sys/opencrypto/cryptosoft.c 116924 2003-06-27 20:07:10Z sam $");
26
27#include <sys/param.h>
28#include <sys/systm.h>
29#include <sys/malloc.h>
30#include <sys/mbuf.h>
31#include <sys/sysctl.h>
32#include <sys/errno.h>
33#include <sys/random.h>

--- 774 unchanged lines hidden (view full) ---

808 */
809static int
810swcr_freesession(void *arg, u_int64_t tid)
811{
812 struct swcr_data *swd;
813 struct enc_xform *txf;
814 struct auth_hash *axf;
815 struct comp_algo *cxf;
26
27#include <sys/param.h>
28#include <sys/systm.h>
29#include <sys/malloc.h>
30#include <sys/mbuf.h>
31#include <sys/sysctl.h>
32#include <sys/errno.h>
33#include <sys/random.h>

--- 774 unchanged lines hidden (view full) ---

808 */
809static int
810swcr_freesession(void *arg, u_int64_t tid)
811{
812 struct swcr_data *swd;
813 struct enc_xform *txf;
814 struct auth_hash *axf;
815 struct comp_algo *cxf;
816 u_int32_t sid = ((u_int32_t) tid) & 0xffffffff;
816 u_int32_t sid = CRYPTO_SESID2LID(tid);
817
818 if (sid > swcr_sesnum || swcr_sessions == NULL ||
819 swcr_sessions[sid] == NULL)
820 return EINVAL;
821
822 /* Silently accept and return */
823 if (sid == 0)
824 return 0;

--- 169 unchanged lines hidden (view full) ---

994}
995
996/*
997 * Initialize the driver, called from the kernel main().
998 */
999static void
1000swcr_init(void)
1001{
817
818 if (sid > swcr_sesnum || swcr_sessions == NULL ||
819 swcr_sessions[sid] == NULL)
820 return EINVAL;
821
822 /* Silently accept and return */
823 if (sid == 0)
824 return 0;

--- 169 unchanged lines hidden (view full) ---

994}
995
996/*
997 * Initialize the driver, called from the kernel main().
998 */
999static void
1000swcr_init(void)
1001{
1002 swcr_id = crypto_get_driverid(CRYPTOCAP_F_SOFTWARE);
1002 swcr_id = crypto_get_driverid(CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_SYNC);
1003 if (swcr_id < 0)
1004 panic("Software crypto device cannot initialize!");
1005 crypto_register(swcr_id, CRYPTO_DES_CBC,
1006 0, 0, swcr_newsession, swcr_freesession, swcr_process, NULL);
1007#define REGISTER(alg) \
1008 crypto_register(swcr_id, alg, 0,0,NULL,NULL,NULL,NULL)
1009 REGISTER(CRYPTO_3DES_CBC);
1010 REGISTER(CRYPTO_BLF_CBC);

--- 17 unchanged lines hidden ---
1003 if (swcr_id < 0)
1004 panic("Software crypto device cannot initialize!");
1005 crypto_register(swcr_id, CRYPTO_DES_CBC,
1006 0, 0, swcr_newsession, swcr_freesession, swcr_process, NULL);
1007#define REGISTER(alg) \
1008 crypto_register(swcr_id, alg, 0,0,NULL,NULL,NULL,NULL)
1009 REGISTER(CRYPTO_3DES_CBC);
1010 REGISTER(CRYPTO_BLF_CBC);

--- 17 unchanged lines hidden ---