aboutsummaryrefslogtreecommitdiff
path: root/bpkg/openssl.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-05-30 14:44:49 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-05-31 00:55:22 +0300
commitbe8ddf26165f25d323657c1e6553af9b42b6d6bf (patch)
tree759584203412294b7b43cf4e05b9f0431c3ec40b /bpkg/openssl.cxx
parent52c0019692491173b934111c31c2a0bba84c6d71 (diff)
Make use of butl::openssl, ifdstream::read_text() and ifdstream::read_binary()
Diffstat (limited to 'bpkg/openssl.cxx')
-rw-r--r--bpkg/openssl.cxx60
1 files changed, 0 insertions, 60 deletions
diff --git a/bpkg/openssl.cxx b/bpkg/openssl.cxx
deleted file mode 100644
index 5a1e29c..0000000
--- a/bpkg/openssl.cxx
+++ /dev/null
@@ -1,60 +0,0 @@
-// file : bpkg/openssl.cxx -*- C++ -*-
-// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
-// license : MIT; see accompanying LICENSE file
-
-#include <bpkg/openssl.hxx>
-
-#include <libbutl/process.hxx>
-
-#include <bpkg/diagnostics.hxx>
-
-using namespace std;
-using namespace butl;
-
-namespace bpkg
-{
- process
- start_openssl (const common_options& co,
- const char* command,
- const cstrings& options,
- bool in,
- bool out,
- bool err)
- {
- cstrings args {co.openssl ().string ().c_str (), command};
-
- // Add extra options. Normally the order of options is not important
- // (unless they override each other). However, openssl 1.0.1 seems to have
- // bugs in that department (that were apparently fixed in 1.0.2). To work
- // around these bugs we pass user-supplied options first.
- //
- for (const string& o: co.openssl_option ())
- args.push_back (o.c_str ());
-
- args.insert (args.end (), options.begin (), options.end ());
- args.push_back (nullptr);
-
- try
- {
- process_path pp (process::path_search (args[0]));
-
- if (verb >= 2)
- print_process (args);
-
- // If the caller is interested in reading STDOUT and STDERR, then
- // redirect STDERR to STDOUT, so both can be read from the same stream.
- //
- return process (
- pp, args.data (), in ? -1 : 0, out ? -1 : 1, err ? (out ? 1 : -1): 2);
- }
- catch (const process_error& e)
- {
- error << "unable to execute " << args[0] << ": " << e;
-
- if (e.child)
- exit (1);
-
- throw failed ();
- }
- }
-}