Index: crypto/pem/pem_lib.c
===================================================================
RCS file: /work/dev/sys/openssl/openssl/crypto/pem/pem_lib.c,v
retrieving revision 1.36.2.9
diff -u -r1.36.2.9 pem_lib.c
--- crypto/pem/pem_lib.c	5 Mar 2004 23:39:12 -0000	1.36.2.9
+++ crypto/pem/pem_lib.c	24 Jun 2004 17:58:24 -0000
@@ -68,6 +68,9 @@
 #ifndef OPENSSL_NO_DES
 #include <openssl/des.h>
 #endif
+#ifdef OPENSSL_FIPS
+#include <openssl/fips.h>
+#endif
 
 const char *PEM_version="PEM" OPENSSL_VERSION_PTEXT;
 
@@ -341,7 +344,11 @@
 			goto err;
 		/* The 'iv' is used as the iv and as a salt.  It is
 		 * NOT taken from the BytesToKey function */
+#ifdef OPENSSL_FIPS
+		EVP_BytesToKey(enc,FIPS_mode ? EVP_sha1() : EVP_md5(),iv,kstr,klen,1,key,NULL);
+#else
 		EVP_BytesToKey(enc,EVP_md5(),iv,kstr,klen,1,key,NULL);
+#endif
 
 		if (kstr == (unsigned char *)buf) OPENSSL_cleanse(buf,PEM_BUFSIZE);
 
@@ -405,9 +412,13 @@
 	/* Convert the pass phrase from EBCDIC */
 	ebcdic2ascii(buf, buf, klen);
 #endif
-
+#ifdef OPENSSL_FIPS
+	EVP_BytesToKey(cipher->cipher,FIPS_mode ? EVP_sha1() : EVP_md5(),&(cipher->iv[0]),
+		(unsigned char *)buf,klen,1,key,NULL);
+#else
 	EVP_BytesToKey(cipher->cipher,EVP_md5(),&(cipher->iv[0]),
 		(unsigned char *)buf,klen,1,key,NULL);
+#endif
 
 	j=(int)len;
 	EVP_CIPHER_CTX_init(&ctx);
