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