rubysl-openssl 0.0.1 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +0 -1
  3. data/.travis.yml +7 -0
  4. data/README.md +2 -2
  5. data/Rakefile +0 -1
  6. data/ext/rubysl/openssl/extconf.h +50 -0
  7. data/ext/rubysl/openssl/extconf.rb +144 -0
  8. data/ext/rubysl/openssl/openssl_missing.c +343 -0
  9. data/ext/rubysl/openssl/openssl_missing.h +191 -0
  10. data/ext/rubysl/openssl/ossl.c +552 -0
  11. data/ext/rubysl/openssl/ossl.h +233 -0
  12. data/ext/rubysl/openssl/ossl_asn1.c +1160 -0
  13. data/ext/rubysl/openssl/ossl_asn1.h +59 -0
  14. data/ext/rubysl/openssl/ossl_bio.c +86 -0
  15. data/ext/rubysl/openssl/ossl_bio.h +21 -0
  16. data/ext/rubysl/openssl/ossl_bn.c +852 -0
  17. data/ext/rubysl/openssl/ossl_bn.h +25 -0
  18. data/ext/rubysl/openssl/ossl_cipher.c +569 -0
  19. data/ext/rubysl/openssl/ossl_cipher.h +22 -0
  20. data/ext/rubysl/openssl/ossl_config.c +75 -0
  21. data/ext/rubysl/openssl/ossl_config.h +22 -0
  22. data/ext/rubysl/openssl/ossl_digest.c +259 -0
  23. data/ext/rubysl/openssl/ossl_digest.h +22 -0
  24. data/ext/rubysl/openssl/ossl_engine.c +411 -0
  25. data/ext/rubysl/openssl/ossl_engine.h +20 -0
  26. data/ext/rubysl/openssl/ossl_hmac.c +268 -0
  27. data/ext/rubysl/openssl/ossl_hmac.h +19 -0
  28. data/ext/rubysl/openssl/ossl_ns_spki.c +257 -0
  29. data/ext/rubysl/openssl/ossl_ns_spki.h +21 -0
  30. data/ext/rubysl/openssl/ossl_ocsp.c +769 -0
  31. data/ext/rubysl/openssl/ossl_ocsp.h +24 -0
  32. data/ext/rubysl/openssl/ossl_pkcs12.c +210 -0
  33. data/ext/rubysl/openssl/ossl_pkcs12.h +15 -0
  34. data/ext/rubysl/openssl/ossl_pkcs5.c +99 -0
  35. data/ext/rubysl/openssl/ossl_pkcs5.h +6 -0
  36. data/ext/rubysl/openssl/ossl_pkcs7.c +1039 -0
  37. data/ext/rubysl/openssl/ossl_pkcs7.h +22 -0
  38. data/ext/rubysl/openssl/ossl_pkey.c +240 -0
  39. data/ext/rubysl/openssl/ossl_pkey.h +141 -0
  40. data/ext/rubysl/openssl/ossl_pkey_dh.c +532 -0
  41. data/ext/rubysl/openssl/ossl_pkey_dsa.c +484 -0
  42. data/ext/rubysl/openssl/ossl_pkey_ec.c +1593 -0
  43. data/ext/rubysl/openssl/ossl_pkey_rsa.c +593 -0
  44. data/ext/rubysl/openssl/ossl_rand.c +202 -0
  45. data/ext/rubysl/openssl/ossl_rand.h +20 -0
  46. data/ext/rubysl/openssl/ossl_ssl.c +1484 -0
  47. data/ext/rubysl/openssl/ossl_ssl.h +36 -0
  48. data/ext/rubysl/openssl/ossl_ssl_session.c +307 -0
  49. data/ext/rubysl/openssl/ossl_version.h +16 -0
  50. data/ext/rubysl/openssl/ossl_x509.c +104 -0
  51. data/ext/rubysl/openssl/ossl_x509.h +114 -0
  52. data/ext/rubysl/openssl/ossl_x509attr.c +274 -0
  53. data/ext/rubysl/openssl/ossl_x509cert.c +764 -0
  54. data/ext/rubysl/openssl/ossl_x509crl.c +535 -0
  55. data/ext/rubysl/openssl/ossl_x509ext.c +458 -0
  56. data/ext/rubysl/openssl/ossl_x509name.c +399 -0
  57. data/ext/rubysl/openssl/ossl_x509req.c +466 -0
  58. data/ext/rubysl/openssl/ossl_x509revoked.c +229 -0
  59. data/ext/rubysl/openssl/ossl_x509store.c +625 -0
  60. data/ext/rubysl/openssl/ruby_missing.h +41 -0
  61. data/lib/openssl.rb +1 -0
  62. data/lib/openssl/bn.rb +35 -0
  63. data/lib/openssl/buffering.rb +241 -0
  64. data/lib/openssl/cipher.rb +65 -0
  65. data/lib/openssl/config.rb +316 -0
  66. data/lib/openssl/digest.rb +61 -0
  67. data/lib/openssl/net/ftptls.rb +53 -0
  68. data/lib/openssl/net/telnets.rb +251 -0
  69. data/lib/openssl/pkcs7.rb +25 -0
  70. data/lib/openssl/ssl-internal.rb +187 -0
  71. data/lib/openssl/ssl.rb +1 -0
  72. data/lib/openssl/x509-internal.rb +153 -0
  73. data/lib/openssl/x509.rb +1 -0
  74. data/lib/rubysl/openssl.rb +28 -0
  75. data/lib/rubysl/openssl/version.rb +5 -0
  76. data/rubysl-openssl.gemspec +19 -18
  77. data/spec/cipher_spec.rb +16 -0
  78. data/spec/config/freeze_spec.rb +17 -0
  79. data/spec/hmac/digest_spec.rb +15 -0
  80. data/spec/hmac/hexdigest_spec.rb +15 -0
  81. data/spec/random/pseudo_bytes_spec.rb +5 -0
  82. data/spec/random/random_bytes_spec.rb +5 -0
  83. data/spec/random/shared/random_bytes.rb +28 -0
  84. data/spec/shared/constants.rb +11 -0
  85. data/spec/x509/name/parse_spec.rb +47 -0
  86. metadata +153 -89
  87. data/lib/rubysl-openssl.rb +0 -7
  88. data/lib/rubysl-openssl/version.rb +0 -5
@@ -0,0 +1,36 @@
1
+ /*
2
+ * $Id: ossl_ssl.h 12496 2007-06-08 15:02:04Z technorama $
3
+ * 'OpenSSL for Ruby' project
4
+ * Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
5
+ * All rights reserved.
6
+ */
7
+ /*
8
+ * This program is licenced under the same licence as Ruby.
9
+ * (See the file 'LICENCE'.)
10
+ */
11
+ #if !defined(_OSSL_SSL_H_)
12
+ #define _OSSL_SSL_H_
13
+
14
+ #define GetSSLSession(obj, sess) do { \
15
+ Data_Get_Struct(obj, SSL_SESSION, sess); \
16
+ if (!sess) { \
17
+ ossl_raise(rb_eRuntimeError, "SSL Session wasn't initialized."); \
18
+ } \
19
+ } while (0)
20
+
21
+ #define SafeGetSSLSession(obj, sess) do { \
22
+ OSSL_Check_Kind(obj, cSSLSession); \
23
+ GetSSLSession(obj, sess); \
24
+ } while (0)
25
+
26
+ extern VALUE mSSL;
27
+ extern VALUE eSSLError;
28
+ extern VALUE cSSLSocket;
29
+ extern VALUE cSSLContext;
30
+ extern VALUE cSSLSession;
31
+
32
+ void Init_ossl_ssl(void);
33
+ void Init_ossl_ssl_session(void);
34
+
35
+ #endif /* _OSSL_SSL_H_ */
36
+
@@ -0,0 +1,307 @@
1
+ /*
2
+ * Copyright (C) 2004-2007 Technorama Ltd. <oss-ruby@technorama.net>
3
+ */
4
+
5
+ #include "ossl.h"
6
+
7
+ #define GetSSLSession(obj, sess) do { \
8
+ Data_Get_Struct(obj, SSL_SESSION, sess); \
9
+ if (!sess) { \
10
+ ossl_raise(rb_eRuntimeError, "SSL Session wasn't initialized."); \
11
+ } \
12
+ } while (0)
13
+
14
+ #define SafeGetSSLSession(obj, sess) do { \
15
+ OSSL_Check_Kind(obj, cSSLSession); \
16
+ GetSSLSession(obj, sess); \
17
+ } while (0)
18
+
19
+
20
+ VALUE cSSLSession;
21
+ static VALUE eSSLSession;
22
+
23
+ static VALUE ossl_ssl_session_alloc(VALUE klass)
24
+ {
25
+ return Data_Wrap_Struct(klass, 0, SSL_SESSION_free, NULL);
26
+ }
27
+
28
+ /*
29
+ * call-seq:
30
+ * Session.new(SSLSocket | string) => session
31
+ *
32
+ * === Parameters
33
+ * +SSLSocket+ is an OpenSSL::SSL::SSLSocket
34
+ * +string+ must be a DER or PEM encoded Session.
35
+ */
36
+ static VALUE ossl_ssl_session_initialize(VALUE self, VALUE arg1)
37
+ {
38
+ SSL_SESSION *ctx = NULL;
39
+ VALUE obj;
40
+ unsigned char *p;
41
+
42
+ if (RDATA(self)->data)
43
+ ossl_raise(eSSLSession, "SSL Session already initialized");
44
+
45
+ if (rb_obj_is_instance_of(arg1, cSSLSocket)) {
46
+ SSL *ssl;
47
+
48
+ Data_Get_Struct(arg1, SSL, ssl);
49
+
50
+ if (!ssl || (ctx = SSL_get1_session(ssl)) == NULL)
51
+ ossl_raise(eSSLSession, "no session available");
52
+ } else {
53
+ BIO *in = ossl_obj2bio(arg1);
54
+
55
+ ctx = PEM_read_bio_SSL_SESSION(in, NULL, NULL, NULL);
56
+
57
+ if (!ctx) {
58
+ BIO_reset(in);
59
+ ctx = d2i_SSL_SESSION_bio(in, NULL);
60
+ }
61
+
62
+ BIO_free(in);
63
+
64
+ if (!ctx)
65
+ ossl_raise(rb_eArgError, "unknown type");
66
+ }
67
+
68
+ /* should not happen */
69
+ if (ctx == NULL)
70
+ ossl_raise(eSSLSession, "ctx not set - internal error");
71
+
72
+ RDATA(self)->data = ctx;
73
+
74
+ return self;
75
+ }
76
+
77
+ /*
78
+ * call-seq:
79
+ * session1 == session2 -> boolean
80
+ *
81
+ */
82
+ static VALUE ossl_ssl_session_eq(VALUE val1, VALUE val2)
83
+ {
84
+ SSL_SESSION *ctx1, *ctx2;
85
+
86
+ GetSSLSession(val1, ctx1);
87
+ SafeGetSSLSession(val2, ctx2);
88
+
89
+ /*
90
+ * OpenSSL 1.0.0betas do not have non-static SSL_SESSION_cmp.
91
+ * ssl_session_cmp (was SSL_SESSION_cmp in 0.9.8) is for lhash
92
+ * comparing so we should not depend on it. Just compare sessions
93
+ * by version and id.
94
+ */
95
+ if ((ctx1->ssl_version == ctx2->ssl_version) &&
96
+ (ctx1->session_id_length == ctx2->session_id_length) &&
97
+ (memcmp(ctx1->session_id, ctx2->session_id, ctx1->session_id_length) == 0)) {
98
+ return Qtrue;
99
+ } else {
100
+ return Qfalse;
101
+ }
102
+ }
103
+
104
+ /*
105
+ * call-seq:
106
+ * session.time -> Time
107
+ *
108
+ */
109
+ static VALUE ossl_ssl_session_get_time(VALUE self)
110
+ {
111
+ SSL_SESSION *ctx;
112
+ long t;
113
+
114
+ GetSSLSession(self, ctx);
115
+
116
+ t = SSL_SESSION_get_time(ctx);
117
+
118
+ if (t == 0)
119
+ return Qnil;
120
+
121
+ return rb_funcall(rb_cTime, rb_intern("at"), 1, LONG2NUM(t));
122
+ }
123
+
124
+ /*
125
+ * call-seq:
126
+ * session.timeout -> integer
127
+ *
128
+ * How long until the session expires in seconds.
129
+ *
130
+ */
131
+ static VALUE ossl_ssl_session_get_timeout(VALUE self)
132
+ {
133
+ SSL_SESSION *ctx;
134
+ long t;
135
+
136
+ GetSSLSession(self, ctx);
137
+
138
+ t = SSL_SESSION_get_timeout(ctx);
139
+
140
+ return LONG2NUM(t);
141
+ }
142
+
143
+ #define SSLSESSION_SET_TIME(func) \
144
+ static VALUE ossl_ssl_session_set_##func(VALUE self, VALUE time_v) \
145
+ { \
146
+ SSL_SESSION *ctx; \
147
+ long t; \
148
+ \
149
+ GetSSLSession(self, ctx); \
150
+ \
151
+ if (rb_obj_is_instance_of(time_v, rb_cTime)) { \
152
+ time_v = rb_funcall(time_v, rb_intern("to_i"), 0); \
153
+ } else if (FIXNUM_P(time_v)) { \
154
+ ; \
155
+ } else { \
156
+ rb_raise(rb_eArgError, "unknown type"); \
157
+ } \
158
+ \
159
+ t = NUM2LONG(time_v); \
160
+ \
161
+ SSL_SESSION_set_##func(ctx, t); \
162
+ \
163
+ return ossl_ssl_session_get_##func(self); \
164
+ }
165
+
166
+ SSLSESSION_SET_TIME(time)
167
+ SSLSESSION_SET_TIME(timeout)
168
+
169
+ #ifdef HAVE_SSL_SESSION_GET_ID
170
+ /*
171
+ * call-seq:
172
+ * session.id -> aString
173
+ *
174
+ * Returns the Session ID.
175
+ */
176
+ static VALUE ossl_ssl_session_get_id(VALUE self)
177
+ {
178
+ SSL_SESSION *ctx;
179
+ const unsigned char *p = NULL;
180
+ unsigned int i = 0;
181
+
182
+ GetSSLSession(self, ctx);
183
+
184
+ p = SSL_SESSION_get_id(ctx, &i);
185
+
186
+ return rb_str_new((const char *) p, i);
187
+ }
188
+ #endif
189
+
190
+ /*
191
+ * call-seq:
192
+ * session.to_der -> aString
193
+ *
194
+ * Returns an ASN1 encoded String that contains the Session object.
195
+ */
196
+ static VALUE ossl_ssl_session_to_der(VALUE self)
197
+ {
198
+ SSL_SESSION *ctx;
199
+ unsigned char buf[1024*10], *p;
200
+ int len;
201
+
202
+ GetSSLSession(self, ctx);
203
+
204
+ p = buf;
205
+ len = i2d_SSL_SESSION(ctx, &p);
206
+
207
+ if (len <= 0)
208
+ ossl_raise(eSSLSession, "i2d_SSL_SESSION");
209
+ else if (len >= sizeof(buf))
210
+ ossl_raise(eSSLSession, "i2d_SSL_SESSION too large");
211
+
212
+ return rb_str_new((const char *) p, len);
213
+ }
214
+
215
+ /*
216
+ * call-seq:
217
+ * session.to_pem -> String
218
+ *
219
+ * Returns a PEM encoded String that contains the Session object.
220
+ */
221
+ static VALUE ossl_ssl_session_to_pem(VALUE self)
222
+ {
223
+ SSL_SESSION *ctx;
224
+ BIO *out;
225
+ BUF_MEM *buf;
226
+ VALUE str;
227
+ int i;
228
+
229
+ GetSSLSession(self, ctx);
230
+
231
+ if (!(out = BIO_new(BIO_s_mem()))) {
232
+ ossl_raise(eSSLSession, "BIO_s_mem()");
233
+ }
234
+
235
+ if (!(i=PEM_write_bio_SSL_SESSION(out, ctx))) {
236
+ BIO_free(out);
237
+ ossl_raise(eSSLSession, "SSL_SESSION_print()");
238
+ }
239
+
240
+ BIO_get_mem_ptr(out, &buf);
241
+ str = rb_str_new(buf->data, buf->length);
242
+ BIO_free(out);
243
+
244
+ return str;
245
+ }
246
+
247
+
248
+ /*
249
+ * call-seq:
250
+ * session.to_text -> String
251
+ *
252
+ * Shows everything in the Session object.
253
+ */
254
+ static VALUE ossl_ssl_session_to_text(VALUE self)
255
+ {
256
+ SSL_SESSION *ctx;
257
+ BIO *out;
258
+ BUF_MEM *buf;
259
+ VALUE str;
260
+
261
+ GetSSLSession(self, ctx);
262
+
263
+ if (!(out = BIO_new(BIO_s_mem()))) {
264
+ ossl_raise(eSSLSession, "BIO_s_mem()");
265
+ }
266
+
267
+ if (!SSL_SESSION_print(out, ctx)) {
268
+ BIO_free(out);
269
+ ossl_raise(eSSLSession, "SSL_SESSION_print()");
270
+ }
271
+
272
+ BIO_get_mem_ptr(out, &buf);
273
+ str = rb_str_new(buf->data, buf->length);
274
+ BIO_free(out);
275
+
276
+ return str;
277
+ }
278
+
279
+
280
+ void Init_ossl_ssl_session(void)
281
+ {
282
+ #if 0 /* let rdoc know about mOSSL */
283
+ mOSSL = rb_define_module("OpenSSL");
284
+ mSSL = rb_define_module_under(mOSSL, "SSL");
285
+ #endif
286
+ cSSLSession = rb_define_class_under(mSSL, "Session", rb_cObject);
287
+ eSSLSession = rb_define_class_under(cSSLSession, "SessionError", eOSSLError);
288
+
289
+ rb_define_alloc_func(cSSLSession, ossl_ssl_session_alloc);
290
+ rb_define_method(cSSLSession, "initialize", ossl_ssl_session_initialize, 1);
291
+
292
+ rb_define_method(cSSLSession, "==", ossl_ssl_session_eq, 1);
293
+
294
+ rb_define_method(cSSLSession, "time", ossl_ssl_session_get_time, 0);
295
+ rb_define_method(cSSLSession, "time=", ossl_ssl_session_set_time, 1);
296
+ rb_define_method(cSSLSession, "timeout", ossl_ssl_session_get_timeout, 0);
297
+ rb_define_method(cSSLSession, "timeout=", ossl_ssl_session_set_timeout, 1);
298
+
299
+ #ifdef HAVE_SSL_SESSION_GET_ID
300
+ rb_define_method(cSSLSession, "id", ossl_ssl_session_get_id, 0);
301
+ #else
302
+ rb_undef_method(cSSLSession, "id");
303
+ #endif
304
+ rb_define_method(cSSLSession, "to_der", ossl_ssl_session_to_der, 0);
305
+ rb_define_method(cSSLSession, "to_pem", ossl_ssl_session_to_pem, 0);
306
+ rb_define_method(cSSLSession, "to_text", ossl_ssl_session_to_text, 0);
307
+ }
@@ -0,0 +1,16 @@
1
+ /*
2
+ * $Id: ossl_version.h 11708 2007-02-12 23:01:19Z shyouhei $
3
+ * 'OpenSSL for Ruby' project
4
+ * Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
5
+ * All rights reserved.
6
+ */
7
+ /*
8
+ * This program is licenced under the same licence as Ruby.
9
+ * (See the file 'LICENCE'.)
10
+ */
11
+ #if !defined(_OSSL_VERSION_H_)
12
+ #define _OSSL_VERSION_H_
13
+
14
+ #define OSSL_VERSION "1.0.0"
15
+
16
+ #endif /* _OSSL_VERSION_H_ */
@@ -0,0 +1,104 @@
1
+ /*
2
+ * $Id: ossl_x509.c 11708 2007-02-12 23:01:19Z shyouhei $
3
+ * 'OpenSSL for Ruby' project
4
+ * Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
5
+ * All rights reserved.
6
+ */
7
+ /*
8
+ * This program is licenced under the same licence as Ruby.
9
+ * (See the file 'LICENCE'.)
10
+ */
11
+ #include "ossl.h"
12
+
13
+ VALUE mX509;
14
+
15
+ #define DefX509Const(x) rb_define_const(mX509, #x,INT2FIX(X509_##x))
16
+ #define DefX509Default(x,i) \
17
+ rb_define_const(mX509, "DEFAULT_" #x, rb_str_new2(X509_get_default_##i()))
18
+
19
+ void
20
+ Init_ossl_x509()
21
+ {
22
+ mX509 = rb_define_module_under(mOSSL, "X509");
23
+
24
+ Init_ossl_x509attr();
25
+ Init_ossl_x509cert();
26
+ Init_ossl_x509crl();
27
+ Init_ossl_x509ext();
28
+ Init_ossl_x509name();
29
+ Init_ossl_x509req();
30
+ Init_ossl_x509revoked();
31
+ Init_ossl_x509store();
32
+
33
+ DefX509Const(V_OK);
34
+ DefX509Const(V_ERR_UNABLE_TO_GET_ISSUER_CERT);
35
+ DefX509Const(V_ERR_UNABLE_TO_GET_CRL);
36
+ DefX509Const(V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE);
37
+ DefX509Const(V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE);
38
+ DefX509Const(V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY);
39
+ DefX509Const(V_ERR_CERT_SIGNATURE_FAILURE);
40
+ DefX509Const(V_ERR_CRL_SIGNATURE_FAILURE);
41
+ DefX509Const(V_ERR_CERT_NOT_YET_VALID);
42
+ DefX509Const(V_ERR_CERT_HAS_EXPIRED);
43
+ DefX509Const(V_ERR_CRL_NOT_YET_VALID);
44
+ DefX509Const(V_ERR_CRL_HAS_EXPIRED);
45
+ DefX509Const(V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD);
46
+ DefX509Const(V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD);
47
+ DefX509Const(V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD);
48
+ DefX509Const(V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD);
49
+ DefX509Const(V_ERR_OUT_OF_MEM);
50
+ DefX509Const(V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT);
51
+ DefX509Const(V_ERR_SELF_SIGNED_CERT_IN_CHAIN);
52
+ DefX509Const(V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY);
53
+ DefX509Const(V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE);
54
+ DefX509Const(V_ERR_CERT_CHAIN_TOO_LONG);
55
+ DefX509Const(V_ERR_CERT_REVOKED);
56
+ DefX509Const(V_ERR_INVALID_CA);
57
+ DefX509Const(V_ERR_PATH_LENGTH_EXCEEDED);
58
+ DefX509Const(V_ERR_INVALID_PURPOSE);
59
+ DefX509Const(V_ERR_CERT_UNTRUSTED);
60
+ DefX509Const(V_ERR_CERT_REJECTED);
61
+ DefX509Const(V_ERR_SUBJECT_ISSUER_MISMATCH);
62
+ DefX509Const(V_ERR_AKID_SKID_MISMATCH);
63
+ DefX509Const(V_ERR_AKID_ISSUER_SERIAL_MISMATCH);
64
+ DefX509Const(V_ERR_KEYUSAGE_NO_CERTSIGN);
65
+ DefX509Const(V_ERR_APPLICATION_VERIFICATION);
66
+
67
+ #if defined(X509_V_FLAG_CRL_CHECK)
68
+ DefX509Const(V_FLAG_CRL_CHECK);
69
+ #endif
70
+ #if defined(X509_V_FLAG_CRL_CHECK_ALL)
71
+ DefX509Const(V_FLAG_CRL_CHECK_ALL);
72
+ #endif
73
+
74
+ DefX509Const(PURPOSE_SSL_CLIENT);
75
+ DefX509Const(PURPOSE_SSL_SERVER);
76
+ DefX509Const(PURPOSE_NS_SSL_SERVER);
77
+ DefX509Const(PURPOSE_SMIME_SIGN);
78
+ DefX509Const(PURPOSE_SMIME_ENCRYPT);
79
+ DefX509Const(PURPOSE_CRL_SIGN);
80
+ DefX509Const(PURPOSE_ANY);
81
+ #if defined(X509_PURPOSE_OCSP_HELPER)
82
+ DefX509Const(PURPOSE_OCSP_HELPER);
83
+ #endif
84
+
85
+ DefX509Const(TRUST_COMPAT);
86
+ DefX509Const(TRUST_SSL_CLIENT);
87
+ DefX509Const(TRUST_SSL_SERVER);
88
+ DefX509Const(TRUST_EMAIL);
89
+ DefX509Const(TRUST_OBJECT_SIGN);
90
+ #if defined(X509_TRUST_OCSP_SIGN)
91
+ DefX509Const(TRUST_OCSP_SIGN);
92
+ #endif
93
+ #if defined(X509_TRUST_OCSP_REQUEST)
94
+ DefX509Const(TRUST_OCSP_REQUEST);
95
+ #endif
96
+
97
+ DefX509Default(CERT_AREA, cert_area);
98
+ DefX509Default(CERT_DIR, cert_dir);
99
+ DefX509Default(CERT_FILE, cert_file);
100
+ DefX509Default(CERT_DIR_ENV, cert_dir_env);
101
+ DefX509Default(CERT_FILE_ENV, cert_file_env);
102
+ DefX509Default(PRIVATE_DIR, private_dir);
103
+ }
104
+