diff options
| author | djm <> | 2005-04-29 05:37:32 +0000 |
|---|---|---|
| committer | djm <> | 2005-04-29 05:37:32 +0000 |
| commit | 588543a0946f1dbf0f1dd5135f8f6447486dc183 (patch) | |
| tree | f74e14f98abfec33221f0f2e15cc88a34a3df7e5 /src/lib/libcrypto/engine/hw_cryptodev.c | |
| parent | 00b426069b0dfa8f0d9b87308646e9684f45c515 (diff) | |
| download | openbsd-588543a0946f1dbf0f1dd5135f8f6447486dc183.tar.gz openbsd-588543a0946f1dbf0f1dd5135f8f6447486dc183.tar.bz2 openbsd-588543a0946f1dbf0f1dd5135f8f6447486dc183.zip | |
import of openssl-0.9.7g; tested on platforms from alpha to zaurus, ok deraadt@
Diffstat (limited to 'src/lib/libcrypto/engine/hw_cryptodev.c')
| -rw-r--r-- | src/lib/libcrypto/engine/hw_cryptodev.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/libcrypto/engine/hw_cryptodev.c b/src/lib/libcrypto/engine/hw_cryptodev.c index 467c0daa1b..3e7fff1c1e 100644 --- a/src/lib/libcrypto/engine/hw_cryptodev.c +++ b/src/lib/libcrypto/engine/hw_cryptodev.c | |||
| @@ -77,7 +77,7 @@ static int cryptodev_max_iv(int cipher); | |||
| 77 | static int cryptodev_key_length_valid(int cipher, int len); | 77 | static int cryptodev_key_length_valid(int cipher, int len); |
| 78 | static int cipher_nid_to_cryptodev(int nid); | 78 | static int cipher_nid_to_cryptodev(int nid); |
| 79 | static int get_cryptodev_ciphers(const int **cnids); | 79 | static int get_cryptodev_ciphers(const int **cnids); |
| 80 | static int get_cryptodev_digests(const int **cnids); | 80 | /*static int get_cryptodev_digests(const int **cnids);*/ |
| 81 | static int cryptodev_usable_ciphers(const int **nids); | 81 | static int cryptodev_usable_ciphers(const int **nids); |
| 82 | static int cryptodev_usable_digests(const int **nids); | 82 | static int cryptodev_usable_digests(const int **nids); |
| 83 | static int cryptodev_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 83 | static int cryptodev_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| @@ -137,6 +137,7 @@ static struct { | |||
| 137 | { 0, NID_undef, 0, 0, }, | 137 | { 0, NID_undef, 0, 0, }, |
| 138 | }; | 138 | }; |
| 139 | 139 | ||
| 140 | #if 0 /* UNUSED */ | ||
| 140 | static struct { | 141 | static struct { |
| 141 | int id; | 142 | int id; |
| 142 | int nid; | 143 | int nid; |
| @@ -149,6 +150,7 @@ static struct { | |||
| 149 | { CRYPTO_SHA1, NID_undef, }, | 150 | { CRYPTO_SHA1, NID_undef, }, |
| 150 | { 0, NID_undef, }, | 151 | { 0, NID_undef, }, |
| 151 | }; | 152 | }; |
| 153 | #endif | ||
| 152 | 154 | ||
| 153 | /* | 155 | /* |
| 154 | * Return a fd if /dev/crypto seems usable, 0 otherwise. | 156 | * Return a fd if /dev/crypto seems usable, 0 otherwise. |
| @@ -258,7 +260,7 @@ get_cryptodev_ciphers(const int **cnids) | |||
| 258 | int fd, i, count = 0; | 260 | int fd, i, count = 0; |
| 259 | 261 | ||
| 260 | if ((fd = get_dev_crypto()) < 0) { | 262 | if ((fd = get_dev_crypto()) < 0) { |
| 261 | *nids = NULL; | 263 | *cnids = NULL; |
| 262 | return (0); | 264 | return (0); |
| 263 | } | 265 | } |
| 264 | memset(&sess, 0, sizeof(sess)); | 266 | memset(&sess, 0, sizeof(sess)); |
| @@ -289,6 +291,7 @@ get_cryptodev_ciphers(const int **cnids) | |||
| 289 | * returning them here is harmless, as long as we return NULL | 291 | * returning them here is harmless, as long as we return NULL |
| 290 | * when asked for a handler in the cryptodev_engine_digests routine | 292 | * when asked for a handler in the cryptodev_engine_digests routine |
| 291 | */ | 293 | */ |
| 294 | #if 0 /* UNUSED */ | ||
| 292 | static int | 295 | static int |
| 293 | get_cryptodev_digests(const int **cnids) | 296 | get_cryptodev_digests(const int **cnids) |
| 294 | { | 297 | { |
| @@ -297,7 +300,7 @@ get_cryptodev_digests(const int **cnids) | |||
| 297 | int fd, i, count = 0; | 300 | int fd, i, count = 0; |
| 298 | 301 | ||
| 299 | if ((fd = get_dev_crypto()) < 0) { | 302 | if ((fd = get_dev_crypto()) < 0) { |
| 300 | *nids = NULL; | 303 | *cnids = NULL; |
| 301 | return (0); | 304 | return (0); |
| 302 | } | 305 | } |
| 303 | memset(&sess, 0, sizeof(sess)); | 306 | memset(&sess, 0, sizeof(sess)); |
| @@ -318,6 +321,7 @@ get_cryptodev_digests(const int **cnids) | |||
| 318 | *cnids = NULL; | 321 | *cnids = NULL; |
| 319 | return (count); | 322 | return (count); |
| 320 | } | 323 | } |
| 324 | #endif | ||
| 321 | 325 | ||
| 322 | /* | 326 | /* |
| 323 | * Find the useable ciphers|digests from dev/crypto - this is the first | 327 | * Find the useable ciphers|digests from dev/crypto - this is the first |
| @@ -623,7 +627,7 @@ static int | |||
| 623 | bn2crparam(const BIGNUM *a, struct crparam *crp) | 627 | bn2crparam(const BIGNUM *a, struct crparam *crp) |
| 624 | { | 628 | { |
| 625 | int i, j, k; | 629 | int i, j, k; |
| 626 | ssize_t words, bytes, bits; | 630 | ssize_t bytes, bits; |
| 627 | u_char *b; | 631 | u_char *b; |
| 628 | 632 | ||
| 629 | crp->crp_p = NULL; | 633 | crp->crp_p = NULL; |
