OGLplus  (0.59.0) a C++ wrapper for rendering APIs

api.hpp
Go to the documentation of this file.
1 #ifndef EAGINE_SSL_API_API_HPP
9 #define EAGINE_SSL_API_API_HPP
10 
11 #include "../callable_ref.hpp"
12 #include "../memory/split_block.hpp"
13 #include "c_api.hpp"
14 #include "object_handle.hpp"
15 #include "object_stack.hpp"
16 #include <eagine/scope_exit.hpp>
17 #include <eagine/string_list.hpp>
18 
19 namespace eagine::sslp {
20 //------------------------------------------------------------------------------
21 #define SSLPAFP(FUNC) decltype(c_api::FUNC), &c_api::FUNC
22 //------------------------------------------------------------------------------
23 class password_callback {
24 public:
25  constexpr password_callback() noexcept = default;
26 
27  constexpr password_callback(
28  callable_ref<bool(string_span, bool)> callback) noexcept
29  : _callback{std::move(callback)} {}
30 
31  constexpr auto native_func() noexcept -> auto* {
32  return _callback ? &_impl : nullptr;
33  }
34 
35  constexpr auto native_data() noexcept -> auto* {
36  return _callback ? static_cast<void*>(this) : nullptr;
37  }
38 
39 private:
40  static auto _impl(char* dst, int len, int writing, void* ptr) -> int {
41  if(auto* self = static_cast<password_callback*>(ptr)) {
42  return self->_callback(
43  string_span(dst, span_size_t(len)), writing != 0)
44  ? 1
45  : 0;
46  }
47  return 0;
48  }
49 
50  callable_ref<bool(string_span, bool)> _callback{};
51 };
52 //------------------------------------------------------------------------------
53 template <typename ApiTraits>
54 class basic_ssl_operations : public basic_ssl_c_api<ApiTraits> {
55 
56 public:
57  using api_traits = ApiTraits;
58  using c_api = basic_ssl_c_api<ApiTraits>;
59 
60  template <typename W, W c_api::*F, typename Signature = typename W::signature>
61  class func;
62 
63  template <typename W, W c_api::*F, typename RVC, typename... Params>
64  class func<W, F, RVC(Params...)>
65  : public wrapped_c_api_function<c_api, api_traits, nothing_t, W, F> {
66  using base = wrapped_c_api_function<c_api, api_traits, nothing_t, W, F>;
67 
68  private:
69  template <typename Res>
70  constexpr auto _check(Res&& res) const noexcept {
71  res.error_code(this->api().err_get_error());
72  return std::forward<Res>(res);
73  }
74 
75  protected:
76  template <typename... Args>
77  constexpr auto _chkcall(Args&&... args) const noexcept {
78  return this->_check(this->_call(std::forward<Args>(args)...));
79  }
80 
81  using base::_conv;
82 
83  template <typename Tag, typename Handle>
84  static constexpr auto _conv(basic_handle<Tag, Handle> obj) noexcept {
85  return static_cast<Handle>(obj);
86  }
87 
88  template <typename Object>
89  static constexpr auto _conv(const object_stack<Object>& stk) noexcept {
90  return stk.native();
91  }
92 
93  template <typename... Args>
94  constexpr auto _cnvchkcall(Args&&... args) const noexcept {
95  return this->_chkcall(_conv(args)...).cast_to(type_identity<RVC>{});
96  }
97 
98  public:
99  using base::base;
100 
101  constexpr auto operator()(Params... params) const noexcept {
102  return this->_chkcall(_conv(params)...)
103  .cast_to(type_identity<RVC>{});
104  }
105 
106  constexpr auto fake() const noexcept {
107  auto result{this->_fake(0)};
108  result.set_unknown_error();
109  return result;
110  }
111  };
112 
113  // null_ui
114  struct : func<SSLPAFP(ui_null)> {
115  using func<SSLPAFP(ui_null)>::func;
116 
117  constexpr auto operator()() const noexcept {
118  return this->_chkcall().cast_to(type_identity<ui_method>{});
119  }
120  } null_ui;
121 
122  // openssl_ui
123  struct : func<SSLPAFP(ui_openssl)> {
124  using func<SSLPAFP(ui_openssl)>::func;
125 
126  constexpr auto operator()() const noexcept {
127  return this->_chkcall().cast_to(type_identity<ui_method>{});
128  }
129  } openssl_ui;
130 
131  // load_builtin_engines
132  struct : func<SSLPAFP(engine_load_builtin_engines)> {
133  using func<SSLPAFP(engine_load_builtin_engines)>::func;
134 
135  constexpr auto operator()() const noexcept {
136  return this->_chkcall();
137  }
138  } load_builtin_engines;
139 
140  // get_first_engine
141  struct : func<SSLPAFP(engine_get_first)> {
142  using func<SSLPAFP(engine_get_first)>::func;
143 
144  constexpr auto operator()() const noexcept {
145  return this->_chkcall().cast_to(type_identity<owned_engine>{});
146  }
147  } get_first_engine;
148 
149  // get_last_engine
150  struct : func<SSLPAFP(engine_get_last)> {
151  using func<SSLPAFP(engine_get_last)>::func;
152 
153  constexpr auto operator()() const noexcept {
154  return this->_chkcall().cast_to(type_identity<owned_engine>{});
155  }
156  } get_last_engine;
157 
158  // get_next_engine
159  struct : func<SSLPAFP(engine_get_next)> {
160  using func<SSLPAFP(engine_get_next)>::func;
161 
162  constexpr auto operator()(owned_engine& eng) const noexcept {
163  return this->_cnvchkcall(eng.release())
164  .cast_to(type_identity<owned_engine>{});
165  }
166  } get_next_engine;
167 
168  // get_prev_engine
169  struct : func<SSLPAFP(engine_get_prev)> {
170  using func<SSLPAFP(engine_get_prev)>::func;
171 
172  constexpr auto operator()(owned_engine& eng) const noexcept {
173  return this->_cnvchkcall(eng.release())
174  .cast_to(type_identity<owned_engine>{});
175  }
176  } get_prev_engine;
177 
178  // new_engine
179  struct : func<SSLPAFP(engine_new)> {
180  using func<SSLPAFP(engine_new)>::func;
181 
182  constexpr auto operator()() const noexcept {
183  return this->_chkcall().cast_to(type_identity<owned_engine>{});
184  }
185  } new_engine;
186 
187  // open_engine
188  struct : func<SSLPAFP(engine_by_id)> {
189  using func<SSLPAFP(engine_by_id)>::func;
190 
191  constexpr auto operator()(string_view id) const noexcept {
192  return this->_cnvchkcall(id).cast_to(type_identity<owned_engine>{});
193  }
194  } open_engine;
195 
196  // copy_engine
197  struct : func<SSLPAFP(engine_up_ref)> {
198  using func<SSLPAFP(engine_up_ref)>::func;
199 
200  constexpr auto operator()(engine eng) const noexcept {
201  return this->_cnvchkcall(eng).replaced_with(owned_engine(eng));
202  }
203  } copy_engine;
204 
205  // delete_engine
206  struct : func<SSLPAFP(engine_free)> {
207  using func<SSLPAFP(engine_free)>::func;
208 
209  constexpr auto operator()(owned_engine& eng) const noexcept {
210  return this->_chkcall(eng.release());
211  }
212 
213  auto raii(owned_engine& eng) const noexcept {
214  return eagine::finally([this, &eng]() { (*this)(eng); });
215  }
216 
217  } delete_engine;
218 
219  // init_engine
220  struct : func<SSLPAFP(engine_init)> {
221  using func<SSLPAFP(engine_init)>::func;
222 
223  constexpr auto operator()(engine eng) const noexcept {
224  return collapse_bool(this->_cnvchkcall(eng));
225  }
226  } init_engine;
227 
228  // finish_engine
229  struct : func<SSLPAFP(engine_finish)> {
230  using func<SSLPAFP(engine_finish)>::func;
231 
232  constexpr auto operator()(engine eng) const noexcept {
233  return collapse_bool(this->_cnvchkcall(eng));
234  }
235 
236  auto raii(owned_engine& eng) const noexcept {
237  return eagine::finally([this, &eng]() { (*this)(eng); });
238  }
239  } finish_engine;
240 
241  // get_engine_id
242  struct : func<SSLPAFP(engine_get_id)> {
243  using func<SSLPAFP(engine_get_id)>::func;
244 
245  constexpr auto operator()(engine eng) const noexcept {
246  return this->_cnvchkcall(eng).cast_to(type_identity<string_view>{});
247  }
248  } get_engine_id;
249 
250  // get_engine_name
251  struct : func<SSLPAFP(engine_get_name)> {
252  using func<SSLPAFP(engine_get_name)>::func;
253 
254  constexpr auto operator()(engine eng) const noexcept {
255  return this->_cnvchkcall(eng).cast_to(type_identity<string_view>{});
256  }
257  } get_engine_name;
258 
259  // set_default_rsa
260  struct : func<SSLPAFP(engine_set_default_rsa)> {
261  using func<SSLPAFP(engine_set_default_rsa)>::func;
262 
263  constexpr auto operator()(engine eng) const noexcept {
264  return this->_cnvchkcall(eng);
265  }
266  } set_default_rsa;
267 
268  // set_default_dsa
269  struct : func<SSLPAFP(engine_set_default_dsa)> {
270  using func<SSLPAFP(engine_set_default_dsa)>::func;
271 
272  constexpr auto operator()(engine eng) const noexcept {
273  return this->_cnvchkcall(eng);
274  }
275  } set_default_dsa;
276 
277  // set_default_dh
278  struct : func<SSLPAFP(engine_set_default_dh)> {
279  using func<SSLPAFP(engine_set_default_dh)>::func;
280 
281  constexpr auto operator()(engine eng) const noexcept {
282  return this->_cnvchkcall(eng);
283  }
284  } set_default_dh;
285 
286  // set_default_rand
287  struct : func<SSLPAFP(engine_set_default_rand)> {
288  using func<SSLPAFP(engine_set_default_rand)>::func;
289 
290  constexpr auto operator()(engine eng) const noexcept {
291  return this->_cnvchkcall(eng);
292  }
293  } set_default_rand;
294 
295  // set_default_ciphers
296  struct : func<SSLPAFP(engine_set_default_ciphers)> {
297  using func<SSLPAFP(engine_set_default_ciphers)>::func;
298 
299  constexpr auto operator()(engine eng) const noexcept {
300  return this->_cnvchkcall(eng);
301  }
302  } set_default_ciphers;
303 
304  // set_default_digests
305  struct : func<SSLPAFP(engine_set_default_digests)> {
306  using func<SSLPAFP(engine_set_default_digests)>::func;
307 
308  constexpr auto operator()(engine eng) const noexcept {
309  return this->_cnvchkcall(eng);
310  }
311  } set_default_digests;
312 
313  // load_engine_private_key
314  struct : func<SSLPAFP(engine_load_private_key)> {
315  using func<SSLPAFP(engine_load_private_key)>::func;
316 
317  constexpr auto operator()(engine eng, string_view key_id, ui_method uim)
318  const noexcept {
319  return this->_cnvchkcall(eng, key_id, uim, nullptr)
320  .cast_to(type_identity<owned_pkey>{});
321  }
322  } load_engine_private_key;
323 
324  // load_engine_public_key
325  struct : func<SSLPAFP(engine_load_public_key)> {
326  using func<SSLPAFP(engine_load_public_key)>::func;
327 
328  constexpr auto
329  operator()(engine eng, string_view key_id) const noexcept {
330  return this->_cnvchkcall(eng, key_id, this->ui_openssl())
331  .cast_to(type_identity<owned_pkey>{});
332  }
333  } load_engine_public_key;
334 
335  // new_basic_io
336  struct : func<SSLPAFP(bio_new)> {
337  using func<SSLPAFP(bio_new)>::func;
338 
339  constexpr auto operator()(basic_io_method method) const noexcept {
340  return this->_chkcall(method).cast_to(
341  type_identity<owned_basic_io>{});
342  }
343  } new_basic_io;
344 
345  // new_block_basic_io
346  struct : func<SSLPAFP(bio_new_mem_buf)> {
347  using func<SSLPAFP(bio_new_mem_buf)>::func;
348 
349  constexpr auto operator()(memory::const_block blk) const noexcept {
350  return this->_chkcall(blk.data(), limit_cast<int>(blk.size()))
351  .cast_to(type_identity<owned_basic_io>{});
352  }
353 
354  } new_block_basic_io;
355 
356  // delete_basic_io
357  struct : func<SSLPAFP(bio_free)> {
358  using func<SSLPAFP(bio_free)>::func;
359 
360  constexpr auto operator()(owned_basic_io& bio) const noexcept {
361  return this->_chkcall(bio.release());
362  }
363 
364  auto raii(owned_basic_io& bio) const noexcept {
365  return eagine::finally([this, &bio]() { (*this)(bio); });
366  }
367 
368  } delete_basic_io;
369 
370  // delete_all_basic_ios
371  struct : func<SSLPAFP(bio_free_all)> {
372  using func<SSLPAFP(bio_free_all)>::func;
373 
374  constexpr auto operator()(owned_basic_io& bio) const noexcept {
375  return this->_chkcall(bio.release());
376  }
377 
378  auto raii(owned_basic_io& bio) const noexcept {
379  return eagine::finally([this, &bio]() { (*this)(bio); });
380  }
381 
382  } delete_all_basic_ios;
383 
384  // random_bytes
385  struct : func<SSLPAFP(rand_bytes)> {
386  using func<SSLPAFP(rand_bytes)>::func;
387 
388  constexpr auto operator()(memory::block blk) const noexcept {
389  return this->_cnvchkcall(blk.data(), limit_cast<int>(blk.size()));
390  }
391 
392  } random_bytes;
393 
394  // copy_pkey
395  struct : func<SSLPAFP(evp_pkey_up_ref)> {
396  using func<SSLPAFP(evp_pkey_up_ref)>::func;
397 
398  constexpr auto operator()(pkey pky) const noexcept {
399  return this->_cnvchkcall(pky).replaced_with(owned_pkey(pky));
400  }
401  } copy_pkey;
402 
403  // delete_pkey
404  struct : func<SSLPAFP(evp_pkey_free)> {
405  using func<SSLPAFP(evp_pkey_free)>::func;
406 
407  constexpr auto operator()(owned_pkey& pky) const noexcept {
408  return this->_chkcall(pky.release());
409  }
410 
411  auto raii(owned_pkey& pky) const noexcept {
412  return eagine::finally([this, &pky]() { (*this)(pky); });
413  }
414 
415  } delete_pkey;
416 
417  // cipher
418  struct : func<SSLPAFP(evp_aes_128_ctr)> {
419  using func<SSLPAFP(evp_aes_128_ctr)>::func;
420 
421  constexpr auto operator()() const noexcept {
422  return this->_chkcall().cast_to(type_identity<cipher_type>{});
423  }
424  } cipher_aes_128_ctr;
425 
426  struct : func<SSLPAFP(evp_aes_128_ccm)> {
427  using func<SSLPAFP(evp_aes_128_ccm)>::func;
428 
429  constexpr auto operator()() const noexcept {
430  return this->_chkcall().cast_to(type_identity<cipher_type>{});
431  }
432  } cipher_aes_128_ccm;
433 
434  struct : func<SSLPAFP(evp_aes_128_gcm)> {
435  using func<SSLPAFP(evp_aes_128_gcm)>::func;
436 
437  constexpr auto operator()() const noexcept {
438  return this->_chkcall().cast_to(type_identity<cipher_type>{});
439  }
440  } cipher_aes_128_gcm;
441 
442  struct : func<SSLPAFP(evp_aes_128_xts)> {
443  using func<SSLPAFP(evp_aes_128_xts)>::func;
444 
445  constexpr auto operator()() const noexcept {
446  return this->_chkcall().cast_to(type_identity<cipher_type>{});
447  }
448  } cipher_aes_128_xts;
449 
450  struct : func<SSLPAFP(evp_aes_192_ecb)> {
451  using func<SSLPAFP(evp_aes_192_ecb)>::func;
452 
453  constexpr auto operator()() const noexcept {
454  return this->_chkcall().cast_to(type_identity<cipher_type>{});
455  }
456  } cipher_aes_192_ecb;
457 
458  struct : func<SSLPAFP(evp_aes_192_cbc)> {
459  using func<SSLPAFP(evp_aes_192_cbc)>::func;
460 
461  constexpr auto operator()() const noexcept {
462  return this->_chkcall().cast_to(type_identity<cipher_type>{});
463  }
464  } cipher_aes_192_cbc;
465 
466  // new_cipher
467  struct : func<SSLPAFP(evp_cipher_ctx_new)> {
468  using func<SSLPAFP(evp_cipher_ctx_new)>::func;
469 
470  constexpr auto operator()() const noexcept {
471  return this->_chkcall().cast_to(type_identity<owned_cipher>{});
472  }
473  } new_cipher;
474 
475  // delete_cipher
476  struct : func<SSLPAFP(evp_cipher_ctx_free)> {
477  using func<SSLPAFP(evp_cipher_ctx_free)>::func;
478 
479  constexpr auto operator()(owned_cipher& cyc) const noexcept {
480  return this->_chkcall(cyc.release());
481  }
482 
483  auto raii(owned_cipher& cyc) const noexcept {
484  return eagine::finally([this, &cyc]() { (*this)(cyc); });
485  }
486 
487  } delete_cipher;
488 
489  // cipher_reset
490  struct : func<SSLPAFP(evp_cipher_ctx_reset)> {
491  using func<SSLPAFP(evp_cipher_ctx_reset)>::func;
492 
493  constexpr auto operator()(cipher cyc) const noexcept {
494  return this->_cnvchkcall(cyc);
495  }
496 
497  } cipher_reset;
498 
499  // cipher_init
500  struct : func<SSLPAFP(evp_cipher_init)> {
501  using func<SSLPAFP(evp_cipher_init)>::func;
502 
503  constexpr auto operator()(
504  cipher cyc,
505  cipher_type cyt,
508  bool enc) const noexcept {
509  return this->_cnvchkcall(
510  cyc, cyt, key.data(), iv.data(), enc ? 1 : 0);
511  }
512  } cipher_init;
513 
514  // cipher_init_ex
515  struct : func<SSLPAFP(evp_cipher_init_ex)> {
516  using func<SSLPAFP(evp_cipher_init_ex)>::func;
517 
518  constexpr auto operator()(
519  cipher cyc,
520  cipher_type cyt,
521  engine eng,
524  bool enc) const noexcept {
525  return this->_cnvchkcall(
526  cyc, cyt, eng, key.data(), iv.data(), enc ? 1 : 0);
527  }
528  } cipher_init_ex;
529 
530  // cipher_update
531  struct : func<SSLPAFP(evp_cipher_update)> {
532  using func<SSLPAFP(evp_cipher_update)>::func;
533 
534  constexpr auto operator()(
535  cipher cyc,
537  memory::const_block in) const noexcept {
538  int outl{0};
539  return this
540  ->_cnvchkcall(
541  cyc,
542  out.tail().data(),
543  &outl,
544  in.data(),
545  limit_cast<int>(in.size()))
546  .replaced_with(out.advance(span_size(outl)));
547  }
548 
549  } cipher_update;
550 
551  // cipher_final
552  struct : func<SSLPAFP(evp_cipher_final)> {
553  using func<SSLPAFP(evp_cipher_final)>::func;
554 
555  constexpr auto
556  operator()(cipher cyc, memory::split_block out) const noexcept {
557  int outl{0U};
558  return this->_cnvchkcall(cyc, out.tail().data(), &outl)
559  .replaced_with(out.advance(span_size(outl)));
560  }
561  } cipher_final;
562 
563  // cipher_final_ex
564  struct : func<SSLPAFP(evp_cipher_final_ex)> {
565  using func<SSLPAFP(evp_cipher_final_ex)>::func;
566 
567  constexpr auto
568  operator()(cipher cyc, memory::split_block out) const noexcept {
569  int outl{0U};
570  return this->_cnvchkcall(cyc, out.tail().data(), &outl)
571  .replaced_with(out.advance(span_size(outl)));
572  }
573  } cipher_final_ex;
574 
575  // encrypt_init
576  struct : func<SSLPAFP(evp_encrypt_init)> {
577  using func<SSLPAFP(evp_encrypt_init)>::func;
578 
579  constexpr auto operator()(
580  cipher cyc,
581  cipher_type cyt,
584  bool enc) const noexcept {
585  return this->_cnvchkcall(
586  cyc, cyt, key.data(), iv.data(), enc ? 1 : 0);
587  }
588  } encrypt_init;
589 
590  // encrypt_init_ex
591  struct : func<SSLPAFP(evp_encrypt_init_ex)> {
592  using func<SSLPAFP(evp_encrypt_init_ex)>::func;
593 
594  constexpr auto operator()(
595  cipher cyc,
596  cipher_type cyt,
597  engine eng,
600  bool enc) const noexcept {
601  return this->_cnvchkcall(
602  cyc, cyt, eng, key.data(), iv.data(), enc ? 1 : 0);
603  }
604  } encrypt_init_ex;
605 
606  // encrypt_update
607  struct : func<SSLPAFP(evp_encrypt_update)> {
608  using func<SSLPAFP(evp_encrypt_update)>::func;
609 
610  constexpr auto operator()(
611  cipher cyc,
613  memory::const_block in) const noexcept {
614  int outl{0};
615  return this
616  ->_cnvchkcall(
617  cyc,
618  out.tail().data(),
619  &outl,
620  in.data(),
621  limit_cast<int>(in.size()))
622  .replaced_with(out.advance(span_size(outl)));
623  }
624 
625  } encrypt_update;
626 
627  // encrypt_final
628  struct : func<SSLPAFP(evp_encrypt_final)> {
629  using func<SSLPAFP(evp_encrypt_final)>::func;
630 
631  constexpr auto
632  operator()(cipher cyc, memory::split_block out) const noexcept {
633  int outl{0U};
634  return this->_cnvchkcall(cyc, out.tail().data(), &outl)
635  .replaced_with(out.advance(span_size(outl)));
636  }
637  } encrypt_final;
638 
639  // encrypt_final_ex
640  struct : func<SSLPAFP(evp_encrypt_final_ex)> {
641  using func<SSLPAFP(evp_encrypt_final_ex)>::func;
642 
643  constexpr auto
644  operator()(cipher cyc, memory::split_block out) const noexcept {
645  int outl{0U};
646  return this->_cnvchkcall(cyc, out.tail().data(), &outl)
647  .replaced_with(out.advance(span_size(outl)));
648  }
649  } encrypt_final_ex;
650 
651  // decrypt_init
652  struct : func<SSLPAFP(evp_decrypt_init)> {
653  using func<SSLPAFP(evp_decrypt_init)>::func;
654 
655  constexpr auto operator()(
656  cipher cyc,
657  cipher_type cyt,
660  bool enc) const noexcept {
661  return this->_cnvchkcall(
662  cyc, cyt, key.data(), iv.data(), enc ? 1 : 0);
663  }
664  } decrypt_init;
665 
666  // decrypt_init_ex
667  struct : func<SSLPAFP(evp_decrypt_init_ex)> {
668  using func<SSLPAFP(evp_decrypt_init_ex)>::func;
669 
670  constexpr auto operator()(
671  cipher cyc,
672  cipher_type cyt,
673  engine eng,
676  bool enc) const noexcept {
677  return this->_cnvchkcall(
678  cyc, cyt, eng, key.data(), iv.data(), enc ? 1 : 0);
679  }
680  } decrypt_init_ex;
681 
682  // decrypt_update
683  struct : func<SSLPAFP(evp_decrypt_update)> {
684  using func<SSLPAFP(evp_decrypt_update)>::func;
685 
686  constexpr auto operator()(
687  cipher cyc,
689  memory::const_block in) const noexcept {
690  int outl{0};
691  return this
692  ->_cnvchkcall(
693  cyc,
694  out.tail().data(),
695  &outl,
696  in.data(),
697  limit_cast<int>(in.size()))
698  .replaced_with(out.advance(span_size(outl)));
699  }
700 
701  } decrypt_update;
702 
703  // decrypt_final
704  struct : func<SSLPAFP(evp_decrypt_final)> {
705  using func<SSLPAFP(evp_decrypt_final)>::func;
706 
707  constexpr auto
708  operator()(cipher cyc, memory::split_block out) const noexcept {
709  int outl{0U};
710  return this->_cnvchkcall(cyc, out.tail().data(), &outl)
711  .replaced_with(out.advance(span_size(outl)));
712  }
713  } decrypt_final;
714 
715  // decrypt_final_ex
716  struct : func<SSLPAFP(evp_decrypt_final_ex)> {
717  using func<SSLPAFP(evp_decrypt_final_ex)>::func;
718 
719  constexpr auto
720  operator()(cipher cyc, memory::split_block out) const noexcept {
721  int outl{0U};
722  return this->_cnvchkcall(cyc, out.tail().data(), &outl)
723  .replaced_with(out.advance(span_size(outl)));
724  }
725  } decrypt_final_ex;
726 
727  // message_digest
728  struct : func<SSLPAFP(evp_md_null)> {
729  using func<SSLPAFP(evp_md_null)>::func;
730 
731  constexpr auto operator()() const noexcept {
732  return this->_chkcall().cast_to(
733  type_identity<message_digest_type>{});
734  }
735  } message_digest_noop;
736 
737  struct : func<SSLPAFP(evp_md5)> {
738  using func<SSLPAFP(evp_md5)>::func;
739 
740  constexpr auto operator()() const noexcept {
741  return this->_chkcall().cast_to(
742  type_identity<message_digest_type>{});
743  }
744  } message_digest_md5;
745 
746  struct : func<SSLPAFP(evp_sha1)> {
747  using func<SSLPAFP(evp_sha1)>::func;
748 
749  constexpr auto operator()() const noexcept {
750  return this->_chkcall().cast_to(
751  type_identity<message_digest_type>{});
752  }
753  } message_digest_sha1;
754 
755  struct : func<SSLPAFP(evp_sha224)> {
756  using func<SSLPAFP(evp_sha224)>::func;
757 
758  constexpr auto operator()() const noexcept {
759  return this->_chkcall().cast_to(
760  type_identity<message_digest_type>{});
761  }
762  } message_digest_sha224;
763 
764  struct : func<SSLPAFP(evp_sha256)> {
765  using func<SSLPAFP(evp_sha256)>::func;
766 
767  constexpr auto operator()() const noexcept {
768  return this->_chkcall().cast_to(
769  type_identity<message_digest_type>{});
770  }
771  } message_digest_sha256;
772 
773  struct : func<SSLPAFP(evp_sha384)> {
774  using func<SSLPAFP(evp_sha384)>::func;
775 
776  constexpr auto operator()() const noexcept {
777  return this->_chkcall().cast_to(
778  type_identity<message_digest_type>{});
779  }
780  } message_digest_sha384;
781 
782  struct : func<SSLPAFP(evp_sha512)> {
783  using func<SSLPAFP(evp_sha512)>::func;
784 
785  constexpr auto operator()() const noexcept {
786  return this->_chkcall().cast_to(
787  type_identity<message_digest_type>{});
788  }
789  } message_digest_sha512;
790 
791  struct : func<SSLPAFP(evp_md_size)> {
792  using func<SSLPAFP(evp_md_size)>::func;
793 
794  constexpr auto operator()(message_digest_type mdt) const noexcept {
795  return this->_cnvchkcall(mdt);
796  }
797  } message_digest_size;
798 
799  // new_message_digest
800  struct : func<SSLPAFP(evp_md_ctx_new)> {
801  using func<SSLPAFP(evp_md_ctx_new)>::func;
802 
803  constexpr auto operator()() const noexcept {
804  return this->_chkcall().cast_to(
805  type_identity<owned_message_digest>{});
806  }
807  } new_message_digest;
808 
809  // delete_message_digest
810  struct : func<SSLPAFP(evp_md_ctx_free)> {
811  using func<SSLPAFP(evp_md_ctx_free)>::func;
812 
813  constexpr auto operator()(owned_message_digest& mdc) const noexcept {
814  return this->_chkcall(mdc.release());
815  }
816 
817  auto raii(owned_message_digest& mdc) const noexcept {
818  return eagine::finally([this, &mdc]() { (*this)(mdc); });
819  }
820 
821  } delete_message_digest;
822 
823  // message_digest_reset
824  struct : func<SSLPAFP(evp_md_ctx_reset)> {
825  using func<SSLPAFP(evp_md_ctx_reset)>::func;
826 
827  constexpr auto operator()(message_digest mdc) const noexcept {
828  return this->_cnvchkcall(mdc);
829  }
830 
831  } message_digest_reset;
832 
833  // message_digest_init
834  struct : func<SSLPAFP(evp_digest_init)> {
835  using func<SSLPAFP(evp_digest_init)>::func;
836 
837  constexpr auto
838  operator()(message_digest mdc, message_digest_type mdt) const noexcept {
839  return this->_cnvchkcall(mdc, mdt);
840  }
841  } message_digest_init;
842 
843  // message_digest_init_ex
844  struct : func<SSLPAFP(evp_digest_init_ex)> {
845  using func<SSLPAFP(evp_digest_init_ex)>::func;
846 
847  constexpr auto operator()(
848  message_digest mdc,
849  message_digest_type mdt,
850  engine eng) const noexcept {
851  return this->_cnvchkcall(mdc, mdt, eng);
852  }
853  } message_digest_init_ex;
854 
855  // message_digest_update
856  struct : func<SSLPAFP(evp_digest_update)> {
857  using func<SSLPAFP(evp_digest_update)>::func;
858 
859  constexpr auto
860  operator()(message_digest mdc, memory::const_block blk) const noexcept {
861  return this->_cnvchkcall(mdc, blk.data(), std_size(blk.size()));
862  }
863 
864  } message_digest_update;
865 
866  // message_digest_final
867  struct : func<SSLPAFP(evp_digest_final)> {
868  using func<SSLPAFP(evp_digest_final)>::func;
869 
870  constexpr auto
871  operator()(message_digest mdc, memory::block blk) const noexcept {
872  unsigned int size{0U};
873  return this->_cnvchkcall(mdc, blk.data(), &size)
874  .replaced_with(head(blk, span_size(size)));
875  }
876  } message_digest_final;
877 
878  // message_digest_final_ex
879  struct : func<SSLPAFP(evp_digest_final_ex)> {
880  using func<SSLPAFP(evp_digest_final_ex)>::func;
881 
882  constexpr auto
883  operator()(message_digest mdc, memory::block blk) const noexcept {
884  unsigned int size{0U};
885  return this->_cnvchkcall(mdc, blk.data(), &size)
886  .replaced_with(head(blk, span_size(size)));
887  }
888  } message_digest_final_ex;
889 
890  // message_digest_sign_init
891  struct : func<SSLPAFP(evp_digest_sign_init)> {
892  using func<SSLPAFP(evp_digest_sign_init)>::func;
893 
894  constexpr auto operator()(
895  message_digest mdc,
896  message_digest_type mdt,
897  pkey pky) const noexcept {
898  return this->_cnvchkcall(mdc, nullptr, mdt, nullptr, pky);
899  }
900 
901  constexpr auto operator()(
902  message_digest mdc,
903  message_digest_type mdt,
904  engine eng,
905  pkey pky) const noexcept {
906  return this->_cnvchkcall(mdc, nullptr, mdt, eng, pky);
907  }
908  } message_digest_sign_init;
909 
910  // message_digest_sign_update
911  struct : func<SSLPAFP(evp_digest_sign_update)> {
912  using func<SSLPAFP(evp_digest_sign_update)>::func;
913 
914  constexpr auto
915  operator()(message_digest mdc, memory::const_block blk) const noexcept {
916  return this->_cnvchkcall(mdc, blk.data(), std_size(blk.size()));
917  }
918 
919  } message_digest_sign_update;
920 
921  // message_digest_sign_final
922  struct : func<SSLPAFP(evp_digest_sign_final)> {
923  using func<SSLPAFP(evp_digest_sign_final)>::func;
924 
925  constexpr auto required_size(message_digest mdc) const noexcept {
926  size_t size{0U};
927  return this->_cnvchkcall(mdc, nullptr, &size)
928  .replaced_with(span_size(size));
929  }
930 
931  constexpr auto
932  operator()(message_digest mdc, memory::block blk) const noexcept {
933  auto size = limit_cast<size_t>(blk.size());
934  return this->_cnvchkcall(mdc, blk.data(), &size)
935  .replaced_with(head(blk, span_size(size)));
936  }
937  } message_digest_sign_final;
938 
939  // message_digest_verify_init
940  struct : func<SSLPAFP(evp_digest_verify_init)> {
941  using func<SSLPAFP(evp_digest_verify_init)>::func;
942 
943  constexpr auto operator()(
944  message_digest mdc,
945  message_digest_type mdt,
946  pkey pky) const noexcept {
947  return this->_cnvchkcall(mdc, nullptr, mdt, nullptr, pky);
948  }
949 
950  constexpr auto operator()(
951  message_digest mdc,
952  message_digest_type mdt,
953  engine eng,
954  pkey pky) const noexcept {
955  return this->_cnvchkcall(mdc, nullptr, mdt, eng, pky);
956  }
957  } message_digest_verify_init;
958 
959  // message_digest_verify_update
960  struct : func<SSLPAFP(evp_digest_verify_update)> {
961  using func<SSLPAFP(evp_digest_verify_update)>::func;
962 
963  constexpr auto
964  operator()(message_digest mdc, memory::const_block blk) const noexcept {
965  return this->_cnvchkcall(mdc, blk.data(), std_size(blk.size()));
966  }
967 
968  } message_digest_verify_update;
969 
970  // message_digest_verify_final
971  struct : func<SSLPAFP(evp_digest_verify_final)> {
972  using func<SSLPAFP(evp_digest_verify_final)>::func;
973 
974  constexpr auto
975  operator()(message_digest mdc, memory::const_block blk) const noexcept {
976  return this->_cnvchkcall(mdc, blk.data(), std_size(blk.size()))
977  .transformed([](int result) { return result == 1; });
978  }
979  } message_digest_verify_final;
980 
981  // new_x509_store_ctx
982  struct : func<SSLPAFP(x509_store_ctx_new)> {
983  using func<SSLPAFP(x509_store_ctx_new)>::func;
984 
985  constexpr auto operator()() const noexcept {
986  return this->_chkcall().cast_to(
987  type_identity<owned_x509_store_ctx>{});
988  }
989  } new_x509_store_ctx;
990 
991  // init_x509_store_ctx
992  struct : func<SSLPAFP(x509_store_ctx_init)> {
993  using func<SSLPAFP(x509_store_ctx_init)>::func;
994 
995  constexpr auto operator()(x509_store_ctx xsc, x509_store xst, x509 crt)
996  const noexcept {
997  return this->_cnvchkcall(xsc, xst, crt, nullptr);
998  }
999 
1000  constexpr auto operator()(
1001  x509_store_ctx xsc,
1002  x509_store xst,
1003  x509 crt,
1004  const object_stack<x509>& chain) const noexcept {
1005  return this->_cnvchkcall(xsc, xst, crt, chain);
1006  }
1007 
1008  } init_x509_store_ctx;
1009 
1010  // set_x509_store_trusted_stack
1011  struct : func<SSLPAFP(x509_store_ctx_set0_trusted_stack)> {
1012  using func<SSLPAFP(x509_store_ctx_set0_trusted_stack)>::func;
1013 
1014  constexpr auto operator()(
1015  x509_store_ctx xsc,
1016  const object_stack<x509>& stk) const noexcept {
1017  return this->_cnvchkcall(xsc, stk);
1018  }
1019 
1020  } set_x509_store_trusted_stack;
1021 
1022  // set_x509_store_verified_chain
1023  struct : func<SSLPAFP(x509_store_ctx_set0_verified_chain)> {
1024  using func<SSLPAFP(x509_store_ctx_set0_verified_chain)>::func;
1025 
1026  constexpr auto operator()(
1027  x509_store_ctx xsc,
1028  const object_stack<x509>& stk) const noexcept {
1029  return this->_cnvchkcall(xsc, stk);
1030  }
1031 
1032  } set_x509_store_verified_chain;
1033 
1034  // set_x509_store_untrusted
1035  struct : func<SSLPAFP(x509_store_ctx_set0_untrusted)> {
1036  using func<SSLPAFP(x509_store_ctx_set0_untrusted)>::func;
1037 
1038  constexpr auto operator()(
1039  x509_store_ctx xsc,
1040  const object_stack<x509>& stk) const noexcept {
1041  return this->_cnvchkcall(xsc, stk);
1042  }
1043 
1044  } set_x509_store_untrusted;
1045 
1046  // cleanup_x509_store_ctx
1047  struct : func<SSLPAFP(x509_store_ctx_cleanup)> {
1048  using func<SSLPAFP(x509_store_ctx_cleanup)>::func;
1049 
1050  constexpr auto operator()(x509_store_ctx xsc) const noexcept {
1051  return this->_chkcall(xsc);
1052  }
1053 
1054  auto raii(x509_store_ctx xsc) const noexcept {
1055  return eagine::finally([this, xsc]() { (*this)(xsc); });
1056  }
1057 
1058  } cleanup_x509_store_ctx;
1059 
1060  // delete_x509_store_ctx
1061  struct : func<SSLPAFP(x509_store_ctx_free)> {
1062  using func<SSLPAFP(x509_store_ctx_free)>::func;
1063 
1064  constexpr auto operator()(owned_x509_store_ctx& xsc) const noexcept {
1065  return this->_chkcall(xsc.release());
1066  }
1067 
1068  auto raii(owned_x509_store_ctx& xsc) const noexcept {
1069  return eagine::finally([this, &xsc]() { (*this)(xsc); });
1070  }
1071 
1072  } delete_x509_store_ctx;
1073 
1074  // x509_verify_certificate
1075  struct : func<SSLPAFP(x509_verify_cert)> {
1076  using func<SSLPAFP(x509_verify_cert)>::func;
1077 
1078  constexpr auto operator()(x509_store_ctx xsc) const noexcept {
1079  return collapse_bool(this->_cnvchkcall(xsc));
1080  }
1081 
1082  } x509_verify_certificate;
1083 
1084  // new_x509_store
1085  struct : func<SSLPAFP(x509_store_new)> {
1086  using func<SSLPAFP(x509_store_new)>::func;
1087 
1088  constexpr auto operator()() const noexcept {
1089  return this->_chkcall().cast_to(type_identity<owned_x509_store>{});
1090  }
1091  } new_x509_store;
1092 
1093  // copy_x509_store
1094  struct : func<SSLPAFP(x509_store_up_ref)> {
1095  using func<SSLPAFP(x509_store_up_ref)>::func;
1096 
1097  constexpr auto operator()(x509_store xst) const noexcept {
1098  return this->_chkcall().replaced_with(owned_x509_store{xst});
1099  }
1100  } copy_x509_store;
1101 
1102  // delete_x509_store
1103  struct : func<SSLPAFP(x509_store_free)> {
1104  using func<SSLPAFP(x509_store_free)>::func;
1105 
1106  constexpr auto operator()(owned_x509_store& xst) const noexcept {
1107  return this->_chkcall(xst.release());
1108  }
1109 
1110  auto raii(owned_x509_store& xst) const noexcept {
1111  return eagine::finally([this, &xst]() { (*this)(xst); });
1112  }
1113 
1114  } delete_x509_store;
1115 
1116  // add_cert_into_x509_store
1117  struct : func<SSLPAFP(x509_store_add_cert)> {
1118  using func<SSLPAFP(x509_store_add_cert)>::func;
1119 
1120  constexpr auto operator()(x509_store xst, x509 crt) const noexcept {
1121  return this->_cnvchkcall(xst, crt);
1122  }
1123 
1124  } add_cert_into_x509_store;
1125 
1126  // add_crl_into_x509_store
1127  struct : func<SSLPAFP(x509_store_add_crl)> {
1128  using func<SSLPAFP(x509_store_add_crl)>::func;
1129 
1130  constexpr auto operator()(x509_store xst, x509_crl crl) const noexcept {
1131  return this->_cnvchkcall(xst, crl);
1132  }
1133 
1134  } add_crl_into_x509_store;
1135 
1136  // load_into_x509_store
1137  struct : func<SSLPAFP(x509_store_load_locations)> {
1138  using func<SSLPAFP(x509_store_load_locations)>::func;
1139 
1140  constexpr auto
1141  operator()(x509_store xst, string_view file_path) const noexcept {
1142  return this->_cnvchkcall(xst, file_path, nullptr);
1143  }
1144 
1145  } load_into_x509_store;
1146 
1147  // new_x509_crl
1148  struct : func<SSLPAFP(x509_crl_new)> {
1149  using func<SSLPAFP(x509_crl_new)>::func;
1150 
1151  constexpr auto operator()() const noexcept {
1152  return this->_chkcall().cast_to(type_identity<owned_x509_crl>{});
1153  }
1154  } new_x509_crl;
1155 
1156  // delete_x509_crl
1157  struct : func<SSLPAFP(x509_crl_free)> {
1158  using func<SSLPAFP(x509_crl_free)>::func;
1159 
1160  constexpr auto operator()(owned_x509_crl& crl) const noexcept {
1161  return this->_chkcall(crl.release());
1162  }
1163 
1164  auto raii(owned_x509_crl& crl) const noexcept {
1165  return eagine::finally([this, &crl]() { (*this)(crl); });
1166  }
1167 
1168  } delete_x509_crl;
1169 
1170  // new_x509
1171  struct : func<SSLPAFP(x509_new)> {
1172  using func<SSLPAFP(x509_new)>::func;
1173 
1174  constexpr auto operator()() const noexcept {
1175  return this->_chkcall().cast_to(type_identity<owned_x509>{});
1176  }
1177  } new_x509;
1178 
1179  // get_x509_pubkey
1180  struct : func<SSLPAFP(x509_get_pubkey)> {
1181  using func<SSLPAFP(x509_get_pubkey)>::func;
1182 
1183  constexpr auto operator()(x509 crt) const noexcept {
1184  return this->_cnvchkcall(crt).cast_to(type_identity<owned_pkey>{});
1185  }
1186  } get_x509_pubkey;
1187 
1188  // delete_x509
1189  struct : func<SSLPAFP(x509_free)> {
1190  using func<SSLPAFP(x509_free)>::func;
1191 
1192  constexpr auto operator()(owned_x509& crt) const noexcept {
1193  return this->_chkcall(crt.release());
1194  }
1195 
1196  auto raii(owned_x509& crt) const noexcept {
1197  return eagine::finally([this, &crt]() { (*this)(crt); });
1198  }
1199 
1200  } delete_x509;
1201 
1202  // read_bio_private_key
1203  struct : func<SSLPAFP(pem_read_bio_private_key)> {
1204  using func<SSLPAFP(pem_read_bio_private_key)>::func;
1205 
1206  constexpr auto operator()(basic_io bio) const noexcept {
1207  return this->_cnvchkcall(bio, nullptr, nullptr, nullptr)
1208  .cast_to(type_identity<owned_pkey>{});
1209  }
1210 
1211  constexpr auto
1212  operator()(basic_io bio, password_callback get_passwd) const noexcept {
1213  return this
1214  ->_cnvchkcall(
1215  bio, nullptr, get_passwd.native_func(), get_passwd.native_data())
1216  .cast_to(type_identity<owned_pkey>{});
1217  }
1218 
1219  } read_bio_private_key;
1220 
1221  // read_bio_public_key
1222  struct : func<SSLPAFP(pem_read_bio_pubkey)> {
1223  using func<SSLPAFP(pem_read_bio_pubkey)>::func;
1224 
1225  constexpr auto operator()(basic_io bio) const noexcept {
1226  return this->_cnvchkcall(bio, nullptr, nullptr, nullptr)
1227  .cast_to(type_identity<owned_pkey>{});
1228  }
1229 
1230  constexpr auto
1231  operator()(basic_io bio, password_callback get_passwd) const noexcept {
1232  return this
1233  ->_cnvchkcall(
1234  bio, nullptr, get_passwd.native_func(), get_passwd.native_data())
1235  .cast_to(type_identity<owned_pkey>{});
1236  }
1237 
1238  } read_bio_public_key;
1239 
1240  // read_bio_x509_crl
1241  struct : func<SSLPAFP(pem_read_bio_x509_crl)> {
1242  using func<SSLPAFP(pem_read_bio_x509_crl)>::func;
1243 
1244  constexpr auto operator()(basic_io bio) const noexcept {
1245  return this->_cnvchkcall(bio, nullptr, nullptr, nullptr)
1246  .cast_to(type_identity<owned_x509_crl>{});
1247  }
1248 
1249  constexpr auto
1250  operator()(basic_io bio, password_callback get_passwd) const noexcept {
1251  return this
1252  ->_cnvchkcall(
1253  bio, nullptr, get_passwd.native_func(), get_passwd.native_data())
1254  .cast_to(type_identity<owned_x509_crl>{});
1255  }
1256 
1257  } read_bio_x509_crl;
1258 
1259  // read_bio_x509
1260  struct : func<SSLPAFP(pem_read_bio_x509)> {
1261  using func<SSLPAFP(pem_read_bio_x509)>::func;
1262 
1263  constexpr auto operator()(basic_io bio) const noexcept {
1264  return this->_cnvchkcall(bio, nullptr, nullptr, nullptr)
1265  .cast_to(type_identity<owned_x509>{});
1266  }
1267 
1268  constexpr auto
1269  operator()(basic_io bio, password_callback get_passwd) const noexcept {
1270  return this
1271  ->_cnvchkcall(
1272  bio, nullptr, get_passwd.native_func(), get_passwd.native_data())
1273  .cast_to(type_identity<owned_x509>{});
1274  }
1275 
1276  } read_bio_x509;
1277 
1278  constexpr basic_ssl_operations(api_traits& traits)
1279  : c_api{traits}
1280  , null_ui("null_ui", traits, *this)
1281  , openssl_ui("openssl_ui", traits, *this)
1282  , load_builtin_engines("load_builtin_engines", traits, *this)
1283  , get_first_engine("get_first_engine", traits, *this)
1284  , get_last_engine("get_last_engine", traits, *this)
1285  , get_next_engine("get_next_engine", traits, *this)
1286  , get_prev_engine("get_prev_engine", traits, *this)
1287  , new_engine("new_engine", traits, *this)
1288  , open_engine("open_engine", traits, *this)
1289  , copy_engine("copy_engine", traits, *this)
1290  , delete_engine("delete_engine", traits, *this)
1291  , init_engine("init_engine", traits, *this)
1292  , finish_engine("finish_engine", traits, *this)
1293  , get_engine_id("get_engine_id", traits, *this)
1294  , get_engine_name("get_engine_name", traits, *this)
1295  , set_default_rsa("set_default_rsa", traits, *this)
1296  , set_default_dsa("set_default_dsa", traits, *this)
1297  , set_default_dh("set_default_dh", traits, *this)
1298  , set_default_rand("set_default_rand", traits, *this)
1299  , set_default_ciphers("set_default_ciphers", traits, *this)
1300  , set_default_digests("set_default_digests", traits, *this)
1301  , load_engine_private_key("load_engine_private_key", traits, *this)
1302  , load_engine_public_key("load_engine_public_key", traits, *this)
1303  , new_basic_io("new_basic_io", traits, *this)
1304  , new_block_basic_io("new_block_basic_io", traits, *this)
1305  , delete_basic_io("delete_basic_io", traits, *this)
1306  , delete_all_basic_ios("delete_all_basic_ios", traits, *this)
1307  , random_bytes("random_bytes", traits, *this)
1308  , copy_pkey("copy_pkey", traits, *this)
1309  , delete_pkey("delete_pkey", traits, *this)
1310  , cipher_aes_128_ctr("cipher_aes_128_ctr", traits, *this)
1311  , cipher_aes_128_ccm("cipher_aes_128_ccm", traits, *this)
1312  , cipher_aes_128_gcm("cipher_aes_128_gcm", traits, *this)
1313  , cipher_aes_128_xts("cipher_aes_128_xts", traits, *this)
1314  , cipher_aes_192_ecb("cipher_aes_192_ecb", traits, *this)
1315  , cipher_aes_192_cbc("cipher_aes_192_cbc", traits, *this)
1316  , new_cipher("new_cipher", traits, *this)
1317  , delete_cipher("delete_cipher", traits, *this)
1318  , cipher_reset("cipher_reset", traits, *this)
1319  , cipher_init("cipher_init", traits, *this)
1320  , cipher_init_ex("cipher_init_ex", traits, *this)
1321  , cipher_update("cipher_update", traits, *this)
1322  , cipher_final("cipher_final", traits, *this)
1323  , cipher_final_ex("cipher_final", traits, *this)
1324  , encrypt_init("encrypt_init", traits, *this)
1325  , encrypt_init_ex("encrypt_init_ex", traits, *this)
1326  , encrypt_update("encrypt_update", traits, *this)
1327  , encrypt_final("encrypt_final", traits, *this)
1328  , encrypt_final_ex("encrypt_final", traits, *this)
1329  , decrypt_init("decrypt_init", traits, *this)
1330  , decrypt_init_ex("decrypt_init_ex", traits, *this)
1331  , decrypt_update("decrypt_update", traits, *this)
1332  , decrypt_final("decrypt_final", traits, *this)
1333  , decrypt_final_ex("decrypt_final", traits, *this)
1334  , message_digest_noop("message_digest_noop", traits, *this)
1335  , message_digest_md5("message_digest_md5", traits, *this)
1336  , message_digest_sha1("message_digest_sha1", traits, *this)
1337  , message_digest_sha224("message_digest_sha224", traits, *this)
1338  , message_digest_sha256("message_digest_sha256", traits, *this)
1339  , message_digest_sha384("message_digest_sha384", traits, *this)
1340  , message_digest_sha512("message_digest_sha512", traits, *this)
1341  , message_digest_size("message_digest_size", traits, *this)
1342  , new_message_digest("new_message_digest", traits, *this)
1343  , delete_message_digest("delete_message_digest", traits, *this)
1344  , message_digest_reset("message_digest_reset", traits, *this)
1345  , message_digest_init("message_digest_init", traits, *this)
1346  , message_digest_init_ex("message_digest_init_ex", traits, *this)
1347  , message_digest_update("message_digest_update", traits, *this)
1348  , message_digest_final("message_digest_final", traits, *this)
1349  , message_digest_final_ex("message_digest_final", traits, *this)
1350  , message_digest_sign_init("message_digest_sign_init", traits, *this)
1351  , message_digest_sign_update("message_digest_sign_update", traits, *this)
1352  , message_digest_sign_final("message_digest_sign_final", traits, *this)
1353  , message_digest_verify_init("message_digest_verify_init", traits, *this)
1354  , message_digest_verify_update(
1355  "message_digest_verify_update",
1356  traits,
1357  *this)
1358  , message_digest_verify_final("message_digest_verify_final", traits, *this)
1359  , new_x509_store_ctx("new_x509_store_ctx", traits, *this)
1360  , init_x509_store_ctx("init_x509_store_ctx", traits, *this)
1361  , set_x509_store_trusted_stack(
1362  "set_x509_store_trusted_stack",
1363  traits,
1364  *this)
1365  , set_x509_store_verified_chain(
1366  "set_x509_store_verified_chain",
1367  traits,
1368  *this)
1369  , set_x509_store_untrusted("set_x509_store_untrusted", traits, *this)
1370  , cleanup_x509_store_ctx("cleanup_x509_store_ctx", traits, *this)
1371  , delete_x509_store_ctx("delete_x509_store_ctx", traits, *this)
1372  , x509_verify_certificate("x509_verify_certificate", traits, *this)
1373  , new_x509_store("new_x509_store", traits, *this)
1374  , copy_x509_store("copy_x509_store", traits, *this)
1375  , delete_x509_store("delete_x509_store", traits, *this)
1376  , add_cert_into_x509_store("add_cert_into_x509_store", traits, *this)
1377  , add_crl_into_x509_store("add_crl_into_x509_store", traits, *this)
1378  , load_into_x509_store("load_into_x509_store", traits, *this)
1379  , new_x509_crl("new_x509_crl", traits, *this)
1380  , delete_x509_crl("delete_x509_crl", traits, *this)
1381  , new_x509("new_x509", traits, *this)
1382  , get_x509_pubkey("get_x509_pubkey", traits, *this)
1383  , delete_x509("delete_x509", traits, *this)
1384  , read_bio_private_key("read_bio_private_key", traits, *this)
1385  , read_bio_public_key("read_bio_public_key", traits, *this)
1386  , read_bio_x509_crl("read_bio_x509_crl", traits, *this)
1387  , read_bio_x509("read_bio_x509", traits, *this) {}
1388 };
1389 //------------------------------------------------------------------------------
1390 #undef SSLPAFP
1391 //------------------------------------------------------------------------------
1392 } // namespace eagine::sslp
1393 
1394 #endif // EAGINE_SSL_API_API_HPP
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
basic_string_span< char > string_span
Alias for mutable string spans.
Definition: string_span.hpp:112
static constexpr auto span_size(T v) noexcept
Converts argument to span size type.
Definition: types.hpp:59
basic_block< true > const_block
Alias for const byte memory span.
Definition: block.hpp:32
static constexpr auto head(basic_span< T, P, S > s, L l) noexcept -> basic_span< T, P, S >
Returns the first l elements from the front of a span.
Definition: span_algo.hpp:99
basic_callable_ref< Sig, is_noexcept_function_v< Sig > > callable_ref
Alias for callable object references.
Definition: callable_ref.hpp:191
basic_block< false > block
Alias for non-const byte memory span.
Definition: block.hpp:27
static constexpr auto std_size(T v) noexcept
Converts argument to std size type.
Definition: types.hpp:52
static auto finally(Func func) -> func_on_scope_exit< Func >
Function constructing on-scope-exit actions.
Definition: scope_exit.hpp:144
basic_split_block< false > split_block
Alias for non-const split blocks.
Definition: split_block.hpp:25

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).