aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/pem
diff options
context:
space:
mode:
authorRalf S. Engelschall <rse@openssl.org>1998-12-21 10:56:39 +0000
committerRalf S. Engelschall <rse@openssl.org>1998-12-21 10:56:39 +0000
commit58964a492275ca9a59a0cd9c8155cb2491b4b909 (patch)
treec7b16876a5789463bbbb468ef4829c8129b3d718 /crypto/pem
parentd02b48c63a58ea4367a0e905979f140b7d090f86 (diff)
downloadopenssl-58964a492275ca9a59a0cd9c8155cb2491b4b909.tar.gz
Import of old SSLeay release: SSLeay 0.9.0b
Diffstat (limited to 'crypto/pem')
-rw-r--r--crypto/pem/Makefile.ssl2
-rw-r--r--crypto/pem/ctx_size.c2
-rw-r--r--crypto/pem/pem.h6
-rw-r--r--crypto/pem/pem_all.c39
-rw-r--r--crypto/pem/pem_err.c10
-rw-r--r--crypto/pem/pem_info.c4
-rw-r--r--crypto/pem/pem_lib.c21
-rw-r--r--crypto/pem/pem_seal.c2
-rw-r--r--crypto/pem/pem_sign.c2
9 files changed, 50 insertions, 38 deletions
diff --git a/crypto/pem/Makefile.ssl b/crypto/pem/Makefile.ssl
index 447fcb4c0d..fc04a88fd9 100644
--- a/crypto/pem/Makefile.ssl
+++ b/crypto/pem/Makefile.ssl
@@ -91,6 +91,6 @@ clean:
errors:
perl $(TOP)/util/err-ins.pl $(ERR).err $(ERR).org # SPECIAL CASE .org
perl $(TOP)/util/err-ins.pl $(ERR).err $(ERR).h
- perl ../err/err_genc.pl $(ERR).h $(ERRC).c
+ perl ../err/err_genc.pl -s $(ERR).h $(ERRC).c
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/crypto/pem/ctx_size.c b/crypto/pem/ctx_size.c
index c9e2ce6d0d..87469bc4af 100644
--- a/crypto/pem/ctx_size.c
+++ b/crypto/pem/ctx_size.c
@@ -1,5 +1,5 @@
/* crypto/pem/ctx_size.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
diff --git a/crypto/pem/pem.h b/crypto/pem/pem.h
index 38952509dd..55fbaeffe2 100644
--- a/crypto/pem/pem.h
+++ b/crypto/pem/pem.h
@@ -122,10 +122,10 @@ extern "C" {
#ifndef HEADER_ENVELOPE_H
-#define EVP_ENCODE_CTX_SIZE 92
-#define EVP_MD_SIZE 48
+#define EVP_ENCODE_CTX_SIZE 96
+#define EVP_MD_SIZE 60
#define EVP_MD_CTX_SIZE 152
-#define EVP_CIPHER_SIZE 28
+#define EVP_CIPHER_SIZE 40
#define EVP_CIPHER_CTX_SIZE 4212
#define EVP_MAX_MD_SIZE 20
diff --git a/crypto/pem/pem_all.c b/crypto/pem/pem_all.c
index 5485628f52..d1cda7aabe 100644
--- a/crypto/pem/pem_all.c
+++ b/crypto/pem/pem_all.c
@@ -1,5 +1,5 @@
/* crypto/pem/pem_all.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
@@ -58,13 +58,14 @@
#include <stdio.h>
#undef SSLEAY_MACROS
+#include "cryptlib.h"
#include "bio.h"
#include "evp.h"
#include "x509.h"
#include "pkcs7.h"
#include "pem.h"
-#ifndef WIN16
+#ifndef NO_FP_API
/* The X509 functions */
X509 *PEM_read_X509(fp,x,cb)
FILE *fp;
@@ -85,7 +86,7 @@ int (*cb)();
PEM_STRING_X509,bp,(char **)x,cb));
}
-#ifndef WIN16
+#ifndef NO_FP_API
int PEM_write_X509(fp,x)
FILE *fp;
X509 *x;
@@ -103,7 +104,7 @@ X509 *x;
(char *)x, NULL,NULL,0,NULL));
}
-#ifndef WIN16
+#ifndef NO_FP_API
/* The X509_REQ functions */
X509_REQ *PEM_read_X509_REQ(fp,x,cb)
FILE *fp;
@@ -124,7 +125,7 @@ int (*cb)();
PEM_STRING_X509_REQ,bp,(char **)x,cb));
}
-#ifndef WIN16
+#ifndef NO_FP_API
int PEM_write_X509_REQ(fp,x)
FILE *fp;
X509_REQ *x;
@@ -142,7 +143,7 @@ X509_REQ *x;
bp,(char *)x, NULL,NULL,0,NULL));
}
-#ifndef WIN16
+#ifndef NO_FP_API
/* The X509_CRL functions */
X509_CRL *PEM_read_X509_CRL(fp,x,cb)
FILE *fp;
@@ -163,7 +164,7 @@ int (*cb)();
PEM_STRING_X509_CRL,bp,(char **)x,cb));
}
-#ifndef WIN16
+#ifndef NO_FP_API
int PEM_write_X509_CRL(fp,x)
FILE *fp;
X509_CRL *x;
@@ -182,7 +183,7 @@ X509_CRL *x;
}
#ifndef NO_RSA
-#ifndef WIN16
+#ifndef NO_FP_API
/* The RSAPrivateKey functions */
RSA *PEM_read_RSAPrivateKey(fp,x,cb)
FILE *fp;
@@ -221,7 +222,7 @@ int (*cb)();
PEM_STRING_RSA_PUBLIC,bp,(char **)x,cb));
}
-#ifndef WIN16
+#ifndef NO_FP_API
int PEM_write_RSAPrivateKey(fp,x,enc,kstr,klen,cb)
FILE *fp;
RSA *x;
@@ -267,7 +268,7 @@ RSA *x;
#endif /* !NO_RSA */
#ifndef NO_DSA
-#ifndef WIN16
+#ifndef NO_FP_API
/* The DSAPrivateKey functions */
DSA *PEM_read_DSAPrivateKey(fp,x,cb)
FILE *fp;
@@ -288,7 +289,7 @@ int (*cb)();
PEM_STRING_DSA,bp,(char **)x,cb));
}
-#ifndef WIN16
+#ifndef NO_FP_API
int PEM_write_DSAPrivateKey(fp,x,enc,kstr,klen,cb)
FILE *fp;
DSA *x;
@@ -315,7 +316,7 @@ int (*cb)();
}
#endif
-#ifndef WIN16
+#ifndef NO_FP_API
/* The PrivateKey functions */
EVP_PKEY *PEM_read_PrivateKey(fp,x,cb)
FILE *fp;
@@ -336,7 +337,7 @@ int (*cb)();
PEM_STRING_EVP_PKEY,bp,(char **)x,cb));
}
-#ifndef WIN16
+#ifndef NO_FP_API
int PEM_write_PrivateKey(fp,x,enc,kstr,klen,cb)
FILE *fp;
EVP_PKEY *x;
@@ -364,7 +365,7 @@ int (*cb)();
bp,(char *)x,enc,kstr,klen,cb));
}
-#ifndef WIN16
+#ifndef NO_FP_API
/* The PKCS7 functions */
PKCS7 *PEM_read_PKCS7(fp,x,cb)
FILE *fp;
@@ -385,7 +386,7 @@ int (*cb)();
PEM_STRING_PKCS7,bp,(char **)x,cb));
}
-#ifndef WIN16
+#ifndef NO_FP_API
int PEM_write_PKCS7(fp,x)
FILE *fp;
PKCS7 *x;
@@ -404,7 +405,7 @@ PKCS7 *x;
}
#ifndef NO_DH
-#ifndef WIN16
+#ifndef NO_FP_API
/* The DHparams functions */
DH *PEM_read_DHparams(fp,x,cb)
FILE *fp;
@@ -425,7 +426,7 @@ int (*cb)();
PEM_STRING_DHPARAMS,bp,(char **)x,cb));
}
-#ifndef WIN16
+#ifndef NO_FP_API
int PEM_write_DHparams(fp,x)
FILE *fp;
DH *x;
@@ -445,7 +446,7 @@ DH *x;
#endif
#ifndef NO_DSA
-#ifndef WIN16
+#ifndef NO_FP_API
/* The DSAparams functions */
DSA *PEM_read_DSAparams(fp,x,cb)
FILE *fp;
@@ -466,7 +467,7 @@ int (*cb)();
PEM_STRING_DSAPARAMS,bp,(char **)x,cb));
}
-#ifndef WIN16
+#ifndef NO_FP_API
int PEM_write_DSAparams(fp,x)
FILE *fp;
DSA *x;
diff --git a/crypto/pem/pem_err.c b/crypto/pem/pem_err.c
index b8d95204ea..e17fcdb540 100644
--- a/crypto/pem/pem_err.c
+++ b/crypto/pem/pem_err.c
@@ -60,6 +60,7 @@
#include "pem.h"
/* BEGIN ERROR CODES */
+#ifndef NO_ERR
static ERR_STRING_DATA PEM_str_functs[]=
{
{ERR_PACK(0,PEM_F_DEF_CALLBACK,0), "DEF_CALLBACK"},
@@ -103,14 +104,19 @@ static ERR_STRING_DATA PEM_str_reasons[]=
{0,NULL},
};
+#endif
+
void ERR_load_PEM_strings()
{
static int init=1;
- if (init)
- {
+ if (init);
+ {;
init=0;
+#ifndef NO_ERR
ERR_load_strings(ERR_LIB_PEM,PEM_str_functs);
ERR_load_strings(ERR_LIB_PEM,PEM_str_reasons);
+#endif
+
}
}
diff --git a/crypto/pem/pem_info.c b/crypto/pem/pem_info.c
index aafd9ce7be..4b69833b62 100644
--- a/crypto/pem/pem_info.c
+++ b/crypto/pem/pem_info.c
@@ -1,5 +1,5 @@
/* crypto/pem/pem_info.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
@@ -64,7 +64,7 @@
#include "x509.h"
#include "pem.h"
-#ifndef WIN16
+#ifndef NO_FP_API
STACK *PEM_X509_INFO_read(fp,sk,cb)
FILE *fp;
STACK *sk;
diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c
index 1397d83113..7a2c0ad83b 100644
--- a/crypto/pem/pem_lib.c
+++ b/crypto/pem/pem_lib.c
@@ -1,5 +1,5 @@
/* crypto/pem/pem_lib.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
@@ -68,7 +68,7 @@
#include "des.h"
#endif
-char *PEM_version="PEM part of SSLeay 0.8.1b 29-Jun-1998";
+char *PEM_version="PEM part of SSLeay 0.9.0b 29-Jun-1998";
#define MIN_LENGTH 4
@@ -89,7 +89,7 @@ char *buf;
int num;
int w;
{
-#ifdef WIN16
+#ifdef NO_FP_API
/* We should not ever call the default callback routine from
* windows. */
PEMerr(PEM_F_DEF_CALLBACK,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
@@ -166,7 +166,7 @@ char *str;
buf[j+i*2+1]='\0';
}
-#ifndef WIN16
+#ifndef NO_FP_API
char *PEM_ASN1_read(d2i,name,fp, x, cb)
char *(*d2i)();
char *name;
@@ -241,7 +241,7 @@ err:
return(ret);
}
-#ifndef WIN16
+#ifndef NO_FP_API
int PEM_ASN1_write(i2d,name,fp, x, enc, kstr, klen, callback)
int (*i2d)();
char *name;
@@ -296,7 +296,12 @@ int (*callback)();
}
}
- dsize=i2d(x,NULL);
+ if ((dsize=i2d(x,NULL)) < 0)
+ {
+ PEMerr(PEM_F_PEM_ASN1_WRITE_BIO,ERR_R_MALLOC_FAILURE);
+ dsize=0;
+ goto err;
+ }
/* dzise + 8 bytes are needed */
data=(unsigned char *)Malloc((unsigned int)dsize+20);
if (data == NULL)
@@ -485,7 +490,7 @@ int num;
return(1);
}
-#ifndef WIN16
+#ifndef NO_FP_API
int PEM_write(fp, name, header, data,len)
FILE *fp;
char *name;
@@ -567,7 +572,7 @@ err:
return(0);
}
-#ifndef WIN16
+#ifndef NO_FP_API
int PEM_read(fp, name, header, data,len)
FILE *fp;
char **name;
diff --git a/crypto/pem/pem_seal.c b/crypto/pem/pem_seal.c
index 6acb04ad77..b4b36df453 100644
--- a/crypto/pem/pem_seal.c
+++ b/crypto/pem/pem_seal.c
@@ -1,5 +1,5 @@
/* crypto/pem/pem_seal.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
diff --git a/crypto/pem/pem_sign.c b/crypto/pem/pem_sign.c
index 0df99a3d84..d56f9f9e14 100644
--- a/crypto/pem/pem_sign.c
+++ b/crypto/pem/pem_sign.c
@@ -1,5 +1,5 @@
/* crypto/pem/pem_sign.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written