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 c3808cce7a017a59ad1f5c1b02c560c3caf5f9a7..0ee8c3c5f65911de4f648b610f727e7480dffa4d 100644
(file)
--- a/
crypto/x509v3/v3_pku.c
+++ b/
crypto/x509v3/v3_pku.c
@@
-58,22
+58,14
@@
#include <stdio.h>
#include "cryptlib.h"
#include <stdio.h>
#include "cryptlib.h"
-#include
"asn1.h"
-#include
"asn1_mac.h"
-#include
"x509v3.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,
@@
-81,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);
@@
-108,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;
@@
-119,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();
@@
-134,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);
@@
-143,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);