summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp
diff options
context:
space:
mode:
authordjm <>2009-01-05 21:36:39 +0000
committerdjm <>2009-01-05 21:36:39 +0000
commit13c662ccd1d22d856f1f2defeea26dd18c0af043 (patch)
treee0d2d687fbd4e4e9eb6bc4b178ea069817f0aba4 /src/lib/libcrypto/evp
parentacc5957d1b6d6872ce50e4100edebccea0476481 (diff)
downloadopenbsd-13c662ccd1d22d856f1f2defeea26dd18c0af043.tar.gz
openbsd-13c662ccd1d22d856f1f2defeea26dd18c0af043.tar.bz2
openbsd-13c662ccd1d22d856f1f2defeea26dd18c0af043.zip
update to openssl-0.9.8i; tested by several, especially krw@
Diffstat (limited to 'src/lib/libcrypto/evp')
-rw-r--r--src/lib/libcrypto/evp/Makefile54
-rw-r--r--src/lib/libcrypto/evp/evp.h2
-rw-r--r--src/lib/libcrypto/evp/evp_enc.c13
3 files changed, 44 insertions, 25 deletions
diff --git a/src/lib/libcrypto/evp/Makefile b/src/lib/libcrypto/evp/Makefile
index 8f2555c7e5..9de56dc03d 100644
--- a/src/lib/libcrypto/evp/Makefile
+++ b/src/lib/libcrypto/evp/Makefile
@@ -135,13 +135,17 @@ bio_ok.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
135bio_ok.o: ../../include/openssl/symhacks.h ../cryptlib.h bio_ok.c 135bio_ok.o: ../../include/openssl/symhacks.h ../cryptlib.h bio_ok.c
136c_all.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 136c_all.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
137c_all.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 137c_all.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
138c_all.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 138c_all.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
139c_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h 139c_all.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
140c_all.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 140c_all.o: ../../include/openssl/engine.h ../../include/openssl/err.h
141c_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 141c_all.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
142c_all.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 142c_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
143c_all.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 143c_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
144c_all.o: ../../include/openssl/symhacks.h ../cryptlib.h c_all.c 144c_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
145c_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
146c_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
147c_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
148c_all.o: ../cryptlib.h c_all.c
145c_allc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 149c_allc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
146c_allc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 150c_allc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
147c_allc.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 151c_allc.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
@@ -170,13 +174,17 @@ c_alld.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
170c_alld.o: ../cryptlib.h c_alld.c 174c_alld.o: ../cryptlib.h c_alld.c
171digest.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 175digest.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
172digest.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 176digest.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
173digest.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 177digest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
174digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h 178digest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
175digest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 179digest.o: ../../include/openssl/engine.h ../../include/openssl/err.h
176digest.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 180digest.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
177digest.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 181digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
178digest.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 182digest.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
179digest.o: ../../include/openssl/symhacks.h ../cryptlib.h digest.c 183digest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
184digest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
185digest.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
186digest.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
187digest.o: ../cryptlib.h digest.c
180e_aes.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h 188e_aes.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
181e_aes.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h 189e_aes.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
182e_aes.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 190e_aes.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
@@ -312,13 +320,17 @@ evp_acnf.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_acnf.c
312evp_enc.o: ../../e_os.h ../../include/openssl/asn1.h 320evp_enc.o: ../../e_os.h ../../include/openssl/asn1.h
313evp_enc.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 321evp_enc.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
314evp_enc.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 322evp_enc.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
315evp_enc.o: ../../include/openssl/engine.h ../../include/openssl/err.h 323evp_enc.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
316evp_enc.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h 324evp_enc.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
317evp_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 325evp_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
318evp_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 326evp_enc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
319evp_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h 327evp_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
320evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 328evp_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
321evp_enc.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_enc.c evp_locl.h 329evp_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
330evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
331evp_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
332evp_enc.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
333evp_enc.o: ../cryptlib.h evp_enc.c evp_locl.h
322evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 334evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
323evp_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 335evp_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
324evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h 336evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h
index c19d764c15..1aa2d6fb35 100644
--- a/src/lib/libcrypto/evp/evp.h
+++ b/src/lib/libcrypto/evp/evp.h
@@ -303,6 +303,8 @@ struct env_md_ctx_st
303 * cleaned */ 303 * cleaned */
304#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data 304#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data
305 * in EVP_MD_CTX_cleanup */ 305 * in EVP_MD_CTX_cleanup */
306#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008 /* Allow use of non FIPS digest
307 * in FIPS mode */
306 308
307struct evp_cipher_st 309struct evp_cipher_st
308 { 310 {
diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c
index a1904993bf..6e582c458d 100644
--- a/src/lib/libcrypto/evp/evp_enc.c
+++ b/src/lib/libcrypto/evp/evp_enc.c
@@ -279,7 +279,12 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
279 { 279 {
280 int i,j,bl; 280 int i,j,bl;
281 281
282 OPENSSL_assert(inl > 0); 282 if (inl <= 0)
283 {
284 *outl = 0;
285 return inl == 0;
286 }
287
283 if(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0) 288 if(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0)
284 { 289 {
285 if(ctx->cipher->do_cipher(ctx,out,in,inl)) 290 if(ctx->cipher->do_cipher(ctx,out,in,inl))
@@ -381,10 +386,10 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
381 int fix_len; 386 int fix_len;
382 unsigned int b; 387 unsigned int b;
383 388
384 if (inl == 0) 389 if (inl <= 0)
385 { 390 {
386 *outl=0; 391 *outl = 0;
387 return 1; 392 return inl == 0;
388 } 393 }
389 394
390 if (ctx->flags & EVP_CIPH_NO_PADDING) 395 if (ctx->flags & EVP_CIPH_NO_PADDING)