projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Set ext_list to NULL after use.
[oweals/openssl.git]
/
crypto
/
x509v3
/
v3_pku.c
diff --git
a/crypto/x509v3/v3_pku.c
b/crypto/x509v3/v3_pku.c
index f6d314f5e2c9202d311cfda0949bacaa0c3d9f63..0ee8c3c5f65911de4f648b610f727e7480dffa4d 100644
(file)
--- a/
crypto/x509v3/v3_pku.c
+++ b/
crypto/x509v3/v3_pku.c
@@
-1,4
+1,4
@@
-/* v3_
akey
.c */
+/* v3_
pku
.c */
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
* project 1999.
*/
/* Written by Dr Stephen N Henson (shenson@bigfoot.com) for the OpenSSL
* project 1999.
*/
@@
-57,25
+57,15
@@
*/
#include <stdio.h>
*/
#include <stdio.h>
-#include <stdlib.h>
-#include <pem.h>
-#include <asn1_mac.h>
-#include <err.h>
-#include <objects.h>
-#include <conf.h>
-#include "x509v3.h"
+#include "cryptlib.h"
+#include <openssl/asn1.h>
+#include <openssl/asn1_mac.h>
+#include <openssl/x509v3.h>
-#ifndef NOPROTO
-static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, PKEY_USAGE_PERIOD *usage, BIO *out);
+static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, PKEY_USAGE_PERIOD *usage, BIO *out, int indent);
+/*
static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK *values);
static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK *values);
-
-#else
-
-static int i2r_PKEY_USAGE_PERIOD();
-static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD();
-
-#endif
-
+*/
X509V3_EXT_METHOD v3_pkey_usage_period = {
NID_private_key_usage_period, 0,
(X509V3_EXT_NEW)PKEY_USAGE_PERIOD_new,
X509V3_EXT_METHOD v3_pkey_usage_period = {
NID_private_key_usage_period, 0,
(X509V3_EXT_NEW)PKEY_USAGE_PERIOD_new,
@@
-83,19
+73,11
@@
PKEY_USAGE_PERIOD_free,
(X509V3_EXT_D2I)d2i_PKEY_USAGE_PERIOD,
i2d_PKEY_USAGE_PERIOD,
NULL, NULL, NULL, NULL,
(X509V3_EXT_D2I)d2i_PKEY_USAGE_PERIOD,
i2d_PKEY_USAGE_PERIOD,
NULL, NULL, NULL, NULL,
-(X509V3_EXT_I2R)i2r_PKEY_USAGE_PERIOD,
+(X509V3_EXT_I2R)i2r_PKEY_USAGE_PERIOD,
NULL,
NULL
};
NULL
};
-
-/*
- * ASN1err(ASN1_F_PKEY_USAGE_PERIOD_NEW,ERR_R_MALLOC_FAILURE);
- * ASN1err(ASN1_F_D2I_PKEY_USAGE_PERIOD,ERR_R_MALLOC_FAILURE);
- */
-
-int i2d_PKEY_USAGE_PERIOD(a,pp)
-PKEY_USAGE_PERIOD *a;
-unsigned char **pp;
+int i2d_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD *a, unsigned char **pp)
{
M_ASN1_I2D_vars(a);
{
M_ASN1_I2D_vars(a);
@@
-110,7
+92,7
@@
unsigned char **pp;
M_ASN1_I2D_finish();
}
M_ASN1_I2D_finish();
}
-PKEY_USAGE_PERIOD *PKEY_USAGE_PERIOD_new()
+PKEY_USAGE_PERIOD *PKEY_USAGE_PERIOD_new(
void
)
{
PKEY_USAGE_PERIOD *ret=NULL;
ASN1_CTX c;
{
PKEY_USAGE_PERIOD *ret=NULL;
ASN1_CTX c;
@@
-121,10
+103,8
@@
PKEY_USAGE_PERIOD *PKEY_USAGE_PERIOD_new()
M_ASN1_New_Error(ASN1_F_PKEY_USAGE_PERIOD_NEW);
}
M_ASN1_New_Error(ASN1_F_PKEY_USAGE_PERIOD_NEW);
}
-PKEY_USAGE_PERIOD *d2i_PKEY_USAGE_PERIOD(a,pp,length)
-PKEY_USAGE_PERIOD **a;
-unsigned char **pp;
-long length;
+PKEY_USAGE_PERIOD *d2i_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD **a,
+ unsigned char **pp, long length)
{
M_ASN1_D2I_vars(a,PKEY_USAGE_PERIOD *,PKEY_USAGE_PERIOD_new);
M_ASN1_D2I_Init();
{
M_ASN1_D2I_vars(a,PKEY_USAGE_PERIOD *,PKEY_USAGE_PERIOD_new);
M_ASN1_D2I_Init();
@@
-136,8
+116,7
@@
long length;
M_ASN1_D2I_Finish(a, PKEY_USAGE_PERIOD_free, ASN1_F_D2I_PKEY_USAGE_PERIOD);
}
M_ASN1_D2I_Finish(a, PKEY_USAGE_PERIOD_free, ASN1_F_D2I_PKEY_USAGE_PERIOD);
}
-void PKEY_USAGE_PERIOD_free(a)
-PKEY_USAGE_PERIOD *a;
+void PKEY_USAGE_PERIOD_free(PKEY_USAGE_PERIOD *a)
{
if (a == NULL) return;
ASN1_GENERALIZEDTIME_free(a->notBefore);
{
if (a == NULL) return;
ASN1_GENERALIZEDTIME_free(a->notBefore);
@@
-145,11
+124,10
@@
PKEY_USAGE_PERIOD *a;
Free ((char *)a);
}
Free ((char *)a);
}
-static int i2r_PKEY_USAGE_PERIOD(method, usage, out)
-X509V3_EXT_METHOD *method;
-PKEY_USAGE_PERIOD *usage;
-BIO *out;
+static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method,
+ PKEY_USAGE_PERIOD *usage, BIO *out, int indent)
{
{
+ BIO_printf(out, "%*s", indent, "");
if(usage->notBefore) {
BIO_write(out, "Not Before: ", 12);
ASN1_GENERALIZEDTIME_print(out, usage->notBefore);
if(usage->notBefore) {
BIO_write(out, "Not Before: ", 12);
ASN1_GENERALIZEDTIME_print(out, usage->notBefore);
@@
-162,6
+140,7
@@
BIO *out;
return 1;
}
return 1;
}
+/*
static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(method, ctx, values)
X509V3_EXT_METHOD *method;
X509V3_CTX *ctx;
static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(method, ctx, values)
X509V3_EXT_METHOD *method;
X509V3_CTX *ctx;
@@
-169,4
+148,4
@@
STACK *values;
{
return NULL;
}
{
return NULL;
}
-
+*/