More pissing about to get pem.h to behave properly.
diff --git a/Makefile.org b/Makefile.org
index b5621f2..aad83d4 100644
--- a/Makefile.org
+++ b/Makefile.org
@@ -157,7 +157,7 @@
 	des rc2 rc4 rc5 idea bf cast \
 	bn rsa dsa dh \
 	buffer bio stack lhash rand err objects \
-	evp asn1 x509 x509v3 conf pem txt_db pkcs7 comp
+	evp pem asn1 x509 x509v3 conf txt_db pkcs7 comp
 
 # If you change the INSTALLTOP, make sure to also change the values
 # in crypto/location.h
diff --git a/crypto/Makefile.ssl b/crypto/Makefile.ssl
index 1253286..784ad4d 100644
--- a/crypto/Makefile.ssl
+++ b/crypto/Makefile.ssl
@@ -29,8 +29,7 @@
 	des rc2 rc4 rc5 idea bf cast \
 	bn rsa dsa dh \
 	buffer bio stack lhash rand err objects \
-	evp pem x509 x509v3 \
-	asn1 conf txt_db pkcs7 comp
+	evp pem x509 x509v3 asn1 conf txt_db pkcs7 comp
 
 GENERAL=Makefile README
 
diff --git a/crypto/asn1/Makefile.ssl b/crypto/asn1/Makefile.ssl
index 2cdbfbe..67a26df 100644
--- a/crypto/asn1/Makefile.ssl
+++ b/crypto/asn1/Makefile.ssl
@@ -230,11 +230,11 @@
 a_sign.o: ../../include/dh.h ../../include/dsa.h ../../include/e_os.h
 a_sign.o: ../../include/err.h ../../include/evp.h ../../include/idea.h
 a_sign.o: ../../include/md2.h ../../include/md5.h ../../include/mdc2.h
-a_sign.o: ../../include/objects.h ../../include/pem.h ../../include/pem2.h
-a_sign.o: ../../include/pkcs7.h ../../include/rc2.h ../../include/rc4.h
-a_sign.o: ../../include/rc5.h ../../include/ripemd.h ../../include/rsa.h
-a_sign.o: ../../include/sha.h ../../include/stack.h ../../include/x509.h
-a_sign.o: ../../include/x509_vfy.h ../cryptlib.h ../crypto.h asn1.h
+a_sign.o: ../../include/objects.h ../../include/pkcs7.h ../../include/rc2.h
+a_sign.o: ../../include/rc4.h ../../include/rc5.h ../../include/ripemd.h
+a_sign.o: ../../include/rsa.h ../../include/sha.h ../../include/stack.h
+a_sign.o: ../../include/x509.h ../../include/x509_vfy.h ../cryptlib.h
+a_sign.o: ../crypto.h asn1.h
 a_time.o: ../../include/bio.h ../../include/bn.h ../../include/buffer.h
 a_time.o: ../../include/e_os.h ../../include/err.h ../../include/stack.h
 a_time.o: ../cryptlib.h ../crypto.h asn1.h
@@ -256,11 +256,11 @@
 a_verify.o: ../../include/dh.h ../../include/dsa.h ../../include/e_os.h
 a_verify.o: ../../include/err.h ../../include/evp.h ../../include/idea.h
 a_verify.o: ../../include/md2.h ../../include/md5.h ../../include/mdc2.h
-a_verify.o: ../../include/objects.h ../../include/pem.h ../../include/pem2.h
-a_verify.o: ../../include/pkcs7.h ../../include/rc2.h ../../include/rc4.h
-a_verify.o: ../../include/rc5.h ../../include/ripemd.h ../../include/rsa.h
-a_verify.o: ../../include/sha.h ../../include/stack.h ../../include/x509.h
-a_verify.o: ../../include/x509_vfy.h ../cryptlib.h ../crypto.h asn1.h
+a_verify.o: ../../include/objects.h ../../include/pkcs7.h ../../include/rc2.h
+a_verify.o: ../../include/rc4.h ../../include/rc5.h ../../include/ripemd.h
+a_verify.o: ../../include/rsa.h ../../include/sha.h ../../include/stack.h
+a_verify.o: ../../include/x509.h ../../include/x509_vfy.h ../cryptlib.h
+a_verify.o: ../crypto.h asn1.h
 asn1_err.o: ../../include/bn.h ../../include/err.h ../../include/stack.h asn1.h
 asn1_lib.o: ../../include/bio.h ../../include/blowfish.h ../../include/bn.h
 asn1_lib.o: ../../include/buffer.h ../../include/cast.h ../../include/des.h
diff --git a/crypto/asn1/a_sign.c b/crypto/asn1/a_sign.c
index c2ff978..9ae9370 100644
--- a/crypto/asn1/a_sign.c
+++ b/crypto/asn1/a_sign.c
@@ -67,7 +67,6 @@
 #include "x509.h"
 #include "objects.h"
 #include "buffer.h"
-#include "pem.h"
 
 int ASN1_sign(i2d,algor1,algor2,signature,data,pkey,type)
 int (*i2d)();
diff --git a/crypto/asn1/a_verify.c b/crypto/asn1/a_verify.c
index 03fc63d..09e7fc0 100644
--- a/crypto/asn1/a_verify.c
+++ b/crypto/asn1/a_verify.c
@@ -67,7 +67,6 @@
 #include "objects.h"
 #include "buffer.h"
 #include "evp.h"
-#include "pem.h"
 
 int ASN1_verify(i2d,a,signature,data,pkey)
 int (*i2d)();
diff --git a/crypto/x509/Makefile.ssl b/crypto/x509/Makefile.ssl
index 67d51f9..039f7da 100644
--- a/crypto/x509/Makefile.ssl
+++ b/crypto/x509/Makefile.ssl
@@ -103,10 +103,10 @@
 by_dir.o: ../../include/e_os.h ../../include/err.h ../../include/evp.h
 by_dir.o: ../../include/idea.h ../../include/lhash.h ../../include/md2.h
 by_dir.o: ../../include/md5.h ../../include/mdc2.h ../../include/objects.h
-by_dir.o: ../../include/pem.h ../../include/pem2.h ../../include/pkcs7.h
-by_dir.o: ../../include/rc2.h ../../include/rc4.h ../../include/rc5.h
-by_dir.o: ../../include/ripemd.h ../../include/rsa.h ../../include/sha.h
-by_dir.o: ../../include/stack.h ../cryptlib.h ../crypto.h x509.h x509_vfy.h
+by_dir.o: ../../include/pkcs7.h ../../include/rc2.h ../../include/rc4.h
+by_dir.o: ../../include/rc5.h ../../include/ripemd.h ../../include/rsa.h
+by_dir.o: ../../include/sha.h ../../include/stack.h ../cryptlib.h ../crypto.h
+by_dir.o: x509.h x509_vfy.h
 by_file.o: ../../include/asn1.h ../../include/bio.h ../../include/blowfish.h
 by_file.o: ../../include/bn.h ../../include/buffer.h ../../include/cast.h
 by_file.o: ../../include/des.h ../../include/dh.h ../../include/dsa.h
@@ -205,11 +205,10 @@
 x509_r2x.o: ../../include/des.h ../../include/dh.h ../../include/dsa.h
 x509_r2x.o: ../../include/e_os.h ../../include/err.h ../../include/evp.h
 x509_r2x.o: ../../include/idea.h ../../include/md2.h ../../include/md5.h
-x509_r2x.o: ../../include/mdc2.h ../../include/objects.h ../../include/pem.h
-x509_r2x.o: ../../include/pem2.h ../../include/pkcs7.h ../../include/rc2.h
-x509_r2x.o: ../../include/rc4.h ../../include/rc5.h ../../include/ripemd.h
-x509_r2x.o: ../../include/rsa.h ../../include/sha.h ../../include/stack.h
-x509_r2x.o: ../cryptlib.h ../crypto.h x509.h x509_vfy.h
+x509_r2x.o: ../../include/mdc2.h ../../include/objects.h ../../include/pkcs7.h
+x509_r2x.o: ../../include/rc2.h ../../include/rc4.h ../../include/rc5.h
+x509_r2x.o: ../../include/ripemd.h ../../include/rsa.h ../../include/sha.h
+x509_r2x.o: ../../include/stack.h ../cryptlib.h ../crypto.h x509.h x509_vfy.h
 x509_req.o: ../../include/asn1.h ../../include/bio.h ../../include/blowfish.h
 x509_req.o: ../../include/bn.h ../../include/buffer.h ../../include/cast.h
 x509_req.o: ../../include/des.h ../../include/dh.h ../../include/dsa.h
@@ -235,10 +234,10 @@
 x509_txt.o: ../../include/e_os.h ../../include/err.h ../../include/evp.h
 x509_txt.o: ../../include/idea.h ../../include/lhash.h ../../include/md2.h
 x509_txt.o: ../../include/md5.h ../../include/mdc2.h ../../include/objects.h
-x509_txt.o: ../../include/pem.h ../../include/pem2.h ../../include/pkcs7.h
-x509_txt.o: ../../include/rc2.h ../../include/rc4.h ../../include/rc5.h
-x509_txt.o: ../../include/ripemd.h ../../include/rsa.h ../../include/sha.h
-x509_txt.o: ../../include/stack.h ../cryptlib.h ../crypto.h x509.h x509_vfy.h
+x509_txt.o: ../../include/pkcs7.h ../../include/rc2.h ../../include/rc4.h
+x509_txt.o: ../../include/rc5.h ../../include/ripemd.h ../../include/rsa.h
+x509_txt.o: ../../include/sha.h ../../include/stack.h ../cryptlib.h ../crypto.h
+x509_txt.o: x509.h x509_vfy.h
 x509_v3.o: ../../include/asn1.h ../../include/bio.h ../../include/blowfish.h
 x509_v3.o: ../../include/bn.h ../../include/buffer.h ../../include/cast.h
 x509_v3.o: ../../include/des.h ../../include/dh.h ../../include/dsa.h
@@ -254,10 +253,10 @@
 x509_vfy.o: ../../include/e_os.h ../../include/err.h ../../include/evp.h
 x509_vfy.o: ../../include/idea.h ../../include/lhash.h ../../include/md2.h
 x509_vfy.o: ../../include/md5.h ../../include/mdc2.h ../../include/objects.h
-x509_vfy.o: ../../include/pem.h ../../include/pem2.h ../../include/pkcs7.h
-x509_vfy.o: ../../include/rc2.h ../../include/rc4.h ../../include/rc5.h
-x509_vfy.o: ../../include/ripemd.h ../../include/rsa.h ../../include/sha.h
-x509_vfy.o: ../../include/stack.h ../cryptlib.h ../crypto.h x509.h x509_vfy.h
+x509_vfy.o: ../../include/pkcs7.h ../../include/rc2.h ../../include/rc4.h
+x509_vfy.o: ../../include/rc5.h ../../include/ripemd.h ../../include/rsa.h
+x509_vfy.o: ../../include/sha.h ../../include/stack.h ../cryptlib.h ../crypto.h
+x509_vfy.o: x509.h x509_vfy.h
 x509name.o: ../../include/asn1.h ../../include/bio.h ../../include/blowfish.h
 x509name.o: ../../include/bn.h ../../include/buffer.h ../../include/cast.h
 x509name.o: ../../include/des.h ../../include/dh.h ../../include/dsa.h
diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c
index ee47582..d16f5bf 100644
--- a/crypto/x509/by_dir.c
+++ b/crypto/x509/by_dir.c
@@ -65,7 +65,6 @@
 #include "cryptlib.h"
 #include "lhash.h"
 #include "x509.h"
-#include "pem.h"
 
 typedef struct lookup_dir_st
 	{
diff --git a/crypto/x509/x509_r2x.c b/crypto/x509/x509_r2x.c
index 2d87213..880e9f6 100644
--- a/crypto/x509/x509_r2x.c
+++ b/crypto/x509/x509_r2x.c
@@ -64,7 +64,6 @@
 #include "x509.h"
 #include "objects.h"
 #include "buffer.h"
-#include "pem.h"
 
 X509 *X509_REQ_to_X509(r,days,pkey)
 X509_REQ *r;
diff --git a/crypto/x509/x509_txt.c b/crypto/x509/x509_txt.c
index 408d1c2..871cc33 100644
--- a/crypto/x509/x509_txt.c
+++ b/crypto/x509/x509_txt.c
@@ -68,7 +68,6 @@
 #include "asn1.h"
 #include "x509.h"
 #include "objects.h"
-#include "pem.h"
 
 char *X509_verify_cert_error_string(n)
 long n;
diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c
index 6a47281..969c016 100644
--- a/crypto/x509/x509_vfy.c
+++ b/crypto/x509/x509_vfy.c
@@ -70,7 +70,6 @@
 #include "asn1.h"
 #include "x509.h"
 #include "objects.h"
-#include "pem.h"
 
 #ifndef NOPROTO
 static int null_callback(int ok,X509_STORE_CTX *e);