| OLD | NEW |
| 1 /* crypto/evp/e_null.c */ | 1 /* crypto/evp/e_null.c */ |
| 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * This package is an SSL implementation written | 5 * This package is an SSL implementation written |
| 6 * by Eric Young (eay@cryptsoft.com). | 6 * by Eric Young (eay@cryptsoft.com). |
| 7 * The implementation was written so as to conform with Netscapes SSL. | 7 * The implementation was written so as to conform with Netscapes SSL. |
| 8 * | 8 * |
| 9 * This library is free for commercial and non-commercial use as long as | 9 * This library is free for commercial and non-commercial use as long as |
| 10 * the following conditions are aheared to. The following conditions | 10 * the following conditions are aheared to. The following conditions |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 */ | 57 */ |
| 58 | 58 |
| 59 #include <stdio.h> | 59 #include <stdio.h> |
| 60 #include "cryptlib.h" | 60 #include "cryptlib.h" |
| 61 #include <openssl/evp.h> | 61 #include <openssl/evp.h> |
| 62 #include <openssl/objects.h> | 62 #include <openssl/objects.h> |
| 63 | 63 |
| 64 static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 64 static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 65 const unsigned char *iv,int enc); | 65 const unsigned char *iv,int enc); |
| 66 static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 66 static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 67 » const unsigned char *in, unsigned int inl); | 67 » const unsigned char *in, size_t inl); |
| 68 static const EVP_CIPHER n_cipher= | 68 static const EVP_CIPHER n_cipher= |
| 69 { | 69 { |
| 70 NID_undef, | 70 NID_undef, |
| 71 1,0,0, | 71 1,0,0, |
| 72 » EVP_CIPH_FLAG_FIPS, | 72 » 0, |
| 73 null_init_key, | 73 null_init_key, |
| 74 null_cipher, | 74 null_cipher, |
| 75 NULL, | 75 NULL, |
| 76 0, | 76 0, |
| 77 NULL, | 77 NULL, |
| 78 NULL, | 78 NULL, |
| 79 NULL, | 79 NULL, |
| 80 NULL | 80 NULL |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 const EVP_CIPHER *EVP_enc_null(void) | 83 const EVP_CIPHER *EVP_enc_null(void) |
| 84 { | 84 { |
| 85 return(&n_cipher); | 85 return(&n_cipher); |
| 86 } | 86 } |
| 87 | 87 |
| 88 static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, | 88 static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, |
| 89 const unsigned char *iv, int enc) | 89 const unsigned char *iv, int enc) |
| 90 { | 90 { |
| 91 /* memset(&(ctx->c),0,sizeof(ctx->c));*/ | 91 /* memset(&(ctx->c),0,sizeof(ctx->c));*/ |
| 92 return 1; | 92 return 1; |
| 93 } | 93 } |
| 94 | 94 |
| 95 static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, | 95 static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, |
| 96 » const unsigned char *in, unsigned int inl) | 96 » const unsigned char *in, size_t inl) |
| 97 { | 97 { |
| 98 if (in != out) | 98 if (in != out) |
| 99 » » memcpy((char *)out,(const char *)in,(size_t)inl); | 99 » » memcpy((char *)out,(const char *)in,inl); |
| 100 return 1; | 100 return 1; |
| 101 } | 101 } |
| 102 | 102 |
| OLD | NEW |