summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/e_rc2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/evp/e_rc2.c')
-rw-r--r--src/lib/libcrypto/evp/e_rc2.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/libcrypto/evp/e_rc2.c b/src/lib/libcrypto/evp/e_rc2.c
index d42cbfd17e..d37726ffae 100644
--- a/src/lib/libcrypto/evp/e_rc2.c
+++ b/src/lib/libcrypto/evp/e_rc2.c
@@ -56,10 +56,11 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#ifndef OPENSSL_NO_RC2
60
61#include <stdio.h> 59#include <stdio.h>
62#include "cryptlib.h" 60#include "cryptlib.h"
61
62#ifndef OPENSSL_NO_RC2
63
63#include <openssl/evp.h> 64#include <openssl/evp.h>
64#include <openssl/objects.h> 65#include <openssl/objects.h>
65#include "evp_locl.h" 66#include "evp_locl.h"
@@ -167,16 +168,17 @@ static int rc2_magic_to_meth(int i)
167static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) 168static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
168 { 169 {
169 long num=0; 170 long num=0;
170 int i=0,l; 171 int i=0;
171 int key_bits; 172 int key_bits;
173 unsigned int l;
172 unsigned char iv[EVP_MAX_IV_LENGTH]; 174 unsigned char iv[EVP_MAX_IV_LENGTH];
173 175
174 if (type != NULL) 176 if (type != NULL)
175 { 177 {
176 l=EVP_CIPHER_CTX_iv_length(c); 178 l=EVP_CIPHER_CTX_iv_length(c);
177 OPENSSL_assert(l <= sizeof iv); 179 OPENSSL_assert(l <= sizeof(iv));
178 i=ASN1_TYPE_get_int_octetstring(type,&num,iv,l); 180 i=ASN1_TYPE_get_int_octetstring(type,&num,iv,l);
179 if (i != l) 181 if (i != (int)l)
180 return(-1); 182 return(-1);
181 key_bits =rc2_magic_to_meth((int)num); 183 key_bits =rc2_magic_to_meth((int)num);
182 if (!key_bits) 184 if (!key_bits)