diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/x_val.c')
-rw-r--r-- | src/lib/libcrypto/asn1/x_val.c | 63 |
1 files changed, 7 insertions, 56 deletions
diff --git a/src/lib/libcrypto/asn1/x_val.c b/src/lib/libcrypto/asn1/x_val.c index a9c390f88c..dc17c67758 100644 --- a/src/lib/libcrypto/asn1/x_val.c +++ b/src/lib/libcrypto/asn1/x_val.c | |||
@@ -58,61 +58,12 @@ | |||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | #include "cryptlib.h" | 60 | #include "cryptlib.h" |
61 | #include "asn1_mac.h" | 61 | #include <openssl/asn1t.h> |
62 | #include <openssl/x509.h> | ||
62 | 63 | ||
63 | /* ASN1err(ASN1_F_X509_VAL_NEW,ERR_R_MALLOC_FAILURE); | 64 | ASN1_SEQUENCE(X509_VAL) = { |
64 | * ASN1err(ASN1_F_X509_VAL_FREE,ERR_R_MALLOC_FAILURE); | 65 | ASN1_SIMPLE(X509_VAL, notBefore, ASN1_TIME), |
65 | * ASN1err(ASN1_F_D2I_X509_VAL,ERR_R_MALLOC_FAILURE); | 66 | ASN1_SIMPLE(X509_VAL, notAfter, ASN1_TIME) |
66 | */ | 67 | } ASN1_SEQUENCE_END(X509_VAL) |
67 | |||
68 | int i2d_X509_VAL(a,pp) | ||
69 | X509_VAL *a; | ||
70 | unsigned char **pp; | ||
71 | { | ||
72 | M_ASN1_I2D_vars(a); | ||
73 | |||
74 | M_ASN1_I2D_len(a->notBefore,i2d_ASN1_UTCTIME); | ||
75 | M_ASN1_I2D_len(a->notAfter,i2d_ASN1_UTCTIME); | ||
76 | |||
77 | M_ASN1_I2D_seq_total(); | ||
78 | |||
79 | M_ASN1_I2D_put(a->notBefore,i2d_ASN1_UTCTIME); | ||
80 | M_ASN1_I2D_put(a->notAfter,i2d_ASN1_UTCTIME); | ||
81 | |||
82 | M_ASN1_I2D_finish(); | ||
83 | } | ||
84 | |||
85 | X509_VAL *d2i_X509_VAL(a,pp,length) | ||
86 | X509_VAL **a; | ||
87 | unsigned char **pp; | ||
88 | long length; | ||
89 | { | ||
90 | M_ASN1_D2I_vars(a,X509_VAL *,X509_VAL_new); | ||
91 | |||
92 | M_ASN1_D2I_Init(); | ||
93 | M_ASN1_D2I_start_sequence(); | ||
94 | M_ASN1_D2I_get(ret->notBefore,d2i_ASN1_UTCTIME); | ||
95 | M_ASN1_D2I_get(ret->notAfter,d2i_ASN1_UTCTIME); | ||
96 | M_ASN1_D2I_Finish(a,X509_VAL_free,ASN1_F_D2I_X509_VAL); | ||
97 | } | ||
98 | |||
99 | X509_VAL *X509_VAL_new() | ||
100 | { | ||
101 | X509_VAL *ret=NULL; | ||
102 | |||
103 | M_ASN1_New_Malloc(ret,X509_VAL); | ||
104 | M_ASN1_New(ret->notBefore,ASN1_UTCTIME_new); | ||
105 | M_ASN1_New(ret->notAfter,ASN1_UTCTIME_new); | ||
106 | return(ret); | ||
107 | M_ASN1_New_Error(ASN1_F_X509_VAL_NEW); | ||
108 | } | ||
109 | |||
110 | void X509_VAL_free(a) | ||
111 | X509_VAL *a; | ||
112 | { | ||
113 | if (a == NULL) return; | ||
114 | ASN1_UTCTIME_free(a->notBefore); | ||
115 | ASN1_UTCTIME_free(a->notAfter); | ||
116 | Free((char *)a); | ||
117 | } | ||
118 | 68 | ||
69 | IMPLEMENT_ASN1_FUNCTIONS(X509_VAL) | ||