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