diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-22 04:36:07 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-22 04:36:07 +0000 |
commit | d46baaac9c1fe58e8a28845731ae7b28780f247c (patch) | |
tree | e642ddca456b0d7adcb430f0c11b2239da1bf210 /crypto/openssl_bio_string.h | |
parent | 22a80ae1d50ada14e6b204978169417d2cebcaea (diff) | |
download | chromium_src-d46baaac9c1fe58e8a28845731ae7b28780f247c.zip chromium_src-d46baaac9c1fe58e8a28845731ae7b28780f247c.tar.gz chromium_src-d46baaac9c1fe58e8a28845731ae7b28780f247c.tar.bz2 |
Add OpenSSL BIO method that writes to a std::string.
BUG=none
Review URL: https://codereview.chromium.org/286263006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'crypto/openssl_bio_string.h')
-rw-r--r-- | crypto/openssl_bio_string.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/crypto/openssl_bio_string.h b/crypto/openssl_bio_string.h new file mode 100644 index 0000000..70d4331 --- /dev/null +++ b/crypto/openssl_bio_string.h @@ -0,0 +1,29 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CRYPTO_OPENSSL_BIO_STRING_H_ +#define CRYPTO_OPENSSL_BIO_STRING_H_ + +#include <string> + +#include "crypto/crypto_export.h" + +// From <openssl/bio.h> +typedef struct bio_st BIO; + +namespace crypto { + +// Creates a new BIO that can be used with OpenSSL's various output functions, +// and which will write all output directly into |out|. This is primarily +// intended as a utility to reduce the amount of copying and separate +// allocations when performing extensive string modifications or streaming +// within OpenSSL. +// +// Note: |out| must remain valid for the duration of the BIO. +BIO* CRYPTO_EXPORT BIO_new_string(std::string* out); + +} // namespace crypto + +#endif // CRYPTO_OPENSSL_BIO_STRING_H_ + |