aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/openssl/holders
diff options
context:
space:
mode:
authordeshevoy <deshevoy@yandex-team.ru>2022-02-10 16:46:56 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:56 +0300
commite988f30484abe5fdeedcc7a5d3c226c01a21800c (patch)
tree0a217b173aabb57b7e51f8a169989b1a3e0309fe /library/cpp/openssl/holders
parent33ee501c05d3f24036ae89766a858930ae66c548 (diff)
downloadydb-e988f30484abe5fdeedcc7a5d3c226c01a21800c.tar.gz
Restoring authorship annotation for <deshevoy@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/openssl/holders')
-rw-r--r--library/cpp/openssl/holders/bio.cpp56
-rw-r--r--library/cpp/openssl/holders/bio.h48
-rw-r--r--library/cpp/openssl/holders/bn.h26
-rw-r--r--library/cpp/openssl/holders/evp.h26
-rw-r--r--library/cpp/openssl/holders/hmac.h20
-rw-r--r--library/cpp/openssl/holders/holder.h62
-rw-r--r--library/cpp/openssl/holders/ut/evp_ut.cpp28
-rw-r--r--library/cpp/openssl/holders/ut/hmac_ut.cpp18
-rw-r--r--library/cpp/openssl/holders/ut/ya.make18
-rw-r--r--library/cpp/openssl/holders/x509_vfy.cpp60
-rw-r--r--library/cpp/openssl/holders/x509_vfy.h48
-rw-r--r--library/cpp/openssl/holders/ya.make32
12 files changed, 221 insertions, 221 deletions
diff --git a/library/cpp/openssl/holders/bio.cpp b/library/cpp/openssl/holders/bio.cpp
index 42cc5fc1ef..5b4eba8234 100644
--- a/library/cpp/openssl/holders/bio.cpp
+++ b/library/cpp/openssl/holders/bio.cpp
@@ -1,29 +1,29 @@
-#include "bio.h"
-
-namespace NOpenSSL {
-
- TBioMethod::TBioMethod(
- int type,
- const char* name,
- int (*write)(BIO*, const char*, int),
- int (*read)(BIO*, char*, int),
- int (*puts)(BIO*, const char*),
- int (*gets)(BIO*, char*, int),
- long (*ctrl)(BIO*, int, long, void*),
- int (*create)(BIO*),
- int (*destroy)(BIO*),
- long (*callbackCtrl)(BIO*, int, bio_info_cb*)
- )
- : THolder(type, name)
- {
+#include "bio.h"
+
+namespace NOpenSSL {
+
+ TBioMethod::TBioMethod(
+ int type,
+ const char* name,
+ int (*write)(BIO*, const char*, int),
+ int (*read)(BIO*, char*, int),
+ int (*puts)(BIO*, const char*),
+ int (*gets)(BIO*, char*, int),
+ long (*ctrl)(BIO*, int, long, void*),
+ int (*create)(BIO*),
+ int (*destroy)(BIO*),
+ long (*callbackCtrl)(BIO*, int, bio_info_cb*)
+ )
+ : THolder(type, name)
+ {
BIO_meth_set_write(*this, write);
- BIO_meth_set_read(*this, read);
- BIO_meth_set_puts(*this, puts);
- BIO_meth_set_gets(*this, gets);
- BIO_meth_set_ctrl(*this, ctrl);
- BIO_meth_set_create(*this, create);
- BIO_meth_set_destroy(*this, destroy);
- BIO_meth_set_callback_ctrl(*this, callbackCtrl);
- }
-
-} // namespace NOpenSSL
+ BIO_meth_set_read(*this, read);
+ BIO_meth_set_puts(*this, puts);
+ BIO_meth_set_gets(*this, gets);
+ BIO_meth_set_ctrl(*this, ctrl);
+ BIO_meth_set_create(*this, create);
+ BIO_meth_set_destroy(*this, destroy);
+ BIO_meth_set_callback_ctrl(*this, callbackCtrl);
+ }
+
+} // namespace NOpenSSL
diff --git a/library/cpp/openssl/holders/bio.h b/library/cpp/openssl/holders/bio.h
index bcd6a7a9d6..2f0b71531f 100644
--- a/library/cpp/openssl/holders/bio.h
+++ b/library/cpp/openssl/holders/bio.h
@@ -1,25 +1,25 @@
-#pragma once
-
-#include <contrib/libs/openssl/include/openssl/bio.h>
-
+#pragma once
+
+#include <contrib/libs/openssl/include/openssl/bio.h>
+
#include <library/cpp/openssl/holders/holder.h>
-
-namespace NOpenSSL {
-
-class TBioMethod : public THolder<BIO_METHOD, BIO_meth_new, BIO_meth_free, int, const char*> {
-public:
- TBioMethod(
- int type,
- const char* name,
- int (*write)(BIO*, const char*, int),
- int (*read)(BIO*, char*, int),
- int (*puts)(BIO*, const char*),
- int (*gets)(BIO*, char*, int),
- long (*ctrl)(BIO*, int, long, void*),
- int (*create)(BIO*),
- int (*destroy)(BIO*),
- long (*callbackCtrl)(BIO*, int, bio_info_cb*)
- );
-};
-
-} // namespace NOpenSSL
+
+namespace NOpenSSL {
+
+class TBioMethod : public THolder<BIO_METHOD, BIO_meth_new, BIO_meth_free, int, const char*> {
+public:
+ TBioMethod(
+ int type,
+ const char* name,
+ int (*write)(BIO*, const char*, int),
+ int (*read)(BIO*, char*, int),
+ int (*puts)(BIO*, const char*),
+ int (*gets)(BIO*, char*, int),
+ long (*ctrl)(BIO*, int, long, void*),
+ int (*create)(BIO*),
+ int (*destroy)(BIO*),
+ long (*callbackCtrl)(BIO*, int, bio_info_cb*)
+ );
+};
+
+} // namespace NOpenSSL
diff --git a/library/cpp/openssl/holders/bn.h b/library/cpp/openssl/holders/bn.h
index 9d133d4bdd..a1a5eb3435 100644
--- a/library/cpp/openssl/holders/bn.h
+++ b/library/cpp/openssl/holders/bn.h
@@ -1,13 +1,13 @@
-#pragma once
-
-#include "holder.h"
-
-#include <contrib/libs/openssl/include/openssl/bn.h>
-
-namespace NOpenSSL {
- class TBignum : public THolder<BIGNUM, BN_new, BN_clear_free> {
- };
-
- class TBnCtx : public THolder<BN_CTX, BN_CTX_new, BN_CTX_free> {
- };
-}
+#pragma once
+
+#include "holder.h"
+
+#include <contrib/libs/openssl/include/openssl/bn.h>
+
+namespace NOpenSSL {
+ class TBignum : public THolder<BIGNUM, BN_new, BN_clear_free> {
+ };
+
+ class TBnCtx : public THolder<BN_CTX, BN_CTX_new, BN_CTX_free> {
+ };
+}
diff --git a/library/cpp/openssl/holders/evp.h b/library/cpp/openssl/holders/evp.h
index df3cc4c2fa..43240c1640 100644
--- a/library/cpp/openssl/holders/evp.h
+++ b/library/cpp/openssl/holders/evp.h
@@ -1,13 +1,13 @@
-#pragma once
-
-#include "holder.h"
-
-#include <contrib/libs/openssl/include/openssl/evp.h>
-
-namespace NOpenSSL {
- class TEvpCipherCtx : public THolder<EVP_CIPHER_CTX, EVP_CIPHER_CTX_new, EVP_CIPHER_CTX_free> {
- };
-
- class TEvpMdCtx : public THolder<EVP_MD_CTX, EVP_MD_CTX_new, EVP_MD_CTX_free> {
- };
-}
+#pragma once
+
+#include "holder.h"
+
+#include <contrib/libs/openssl/include/openssl/evp.h>
+
+namespace NOpenSSL {
+ class TEvpCipherCtx : public THolder<EVP_CIPHER_CTX, EVP_CIPHER_CTX_new, EVP_CIPHER_CTX_free> {
+ };
+
+ class TEvpMdCtx : public THolder<EVP_MD_CTX, EVP_MD_CTX_new, EVP_MD_CTX_free> {
+ };
+}
diff --git a/library/cpp/openssl/holders/hmac.h b/library/cpp/openssl/holders/hmac.h
index 4110e06f00..3aa820a569 100644
--- a/library/cpp/openssl/holders/hmac.h
+++ b/library/cpp/openssl/holders/hmac.h
@@ -1,10 +1,10 @@
-#pragma once
-
-#include "holder.h"
-
-#include <contrib/libs/openssl/include/openssl/hmac.h>
-
-namespace NOpenSSL {
- class THmacCtx : public THolder<HMAC_CTX, HMAC_CTX_new, HMAC_CTX_free> {
- };
-}
+#pragma once
+
+#include "holder.h"
+
+#include <contrib/libs/openssl/include/openssl/hmac.h>
+
+namespace NOpenSSL {
+ class THmacCtx : public THolder<HMAC_CTX, HMAC_CTX_new, HMAC_CTX_free> {
+ };
+}
diff --git a/library/cpp/openssl/holders/holder.h b/library/cpp/openssl/holders/holder.h
index c2a26ce431..f6049ebd02 100644
--- a/library/cpp/openssl/holders/holder.h
+++ b/library/cpp/openssl/holders/holder.h
@@ -1,32 +1,32 @@
-#pragma once
-
-#include <util/generic/yexception.h>
-
-namespace NOpenSSL {
-
-template <typename TType, auto Create, auto Destroy, class... Args>
-class THolder {
-public:
- inline THolder(Args... args) {
- Ptr = Create(args...);
- if (!Ptr) {
+#pragma once
+
+#include <util/generic/yexception.h>
+
+namespace NOpenSSL {
+
+template <typename TType, auto Create, auto Destroy, class... Args>
+class THolder {
+public:
+ inline THolder(Args... args) {
+ Ptr = Create(args...);
+ if (!Ptr) {
throw std::bad_alloc();
- }
- }
-
- THolder(const THolder&) = delete;
- THolder& operator=(const THolder&) = delete;
-
- inline ~THolder() noexcept {
- Destroy(Ptr);
- }
-
- inline operator TType* () noexcept {
- return Ptr;
- }
-
-private:
- TType* Ptr;
-};
-
-}
+ }
+ }
+
+ THolder(const THolder&) = delete;
+ THolder& operator=(const THolder&) = delete;
+
+ inline ~THolder() noexcept {
+ Destroy(Ptr);
+ }
+
+ inline operator TType* () noexcept {
+ return Ptr;
+ }
+
+private:
+ TType* Ptr;
+};
+
+}
diff --git a/library/cpp/openssl/holders/ut/evp_ut.cpp b/library/cpp/openssl/holders/ut/evp_ut.cpp
index 0f8c0aed01..7aeec7594c 100644
--- a/library/cpp/openssl/holders/ut/evp_ut.cpp
+++ b/library/cpp/openssl/holders/ut/evp_ut.cpp
@@ -1,15 +1,15 @@
-#include "evp.h"
-
+#include "evp.h"
+
#include <library/cpp/testing/unittest/registar.h>
-
-Y_UNIT_TEST_SUITE(Evp) {
- Y_UNIT_TEST(Cipher) {
- NOpenSSL::TEvpCipherCtx ctx;
- UNIT_ASSERT(ctx);
- }
-
- Y_UNIT_TEST(Md) {
- NOpenSSL::TEvpMdCtx ctx;
- UNIT_ASSERT(ctx);
- }
-}
+
+Y_UNIT_TEST_SUITE(Evp) {
+ Y_UNIT_TEST(Cipher) {
+ NOpenSSL::TEvpCipherCtx ctx;
+ UNIT_ASSERT(ctx);
+ }
+
+ Y_UNIT_TEST(Md) {
+ NOpenSSL::TEvpMdCtx ctx;
+ UNIT_ASSERT(ctx);
+ }
+}
diff --git a/library/cpp/openssl/holders/ut/hmac_ut.cpp b/library/cpp/openssl/holders/ut/hmac_ut.cpp
index 60f561c337..d241bfbe1f 100644
--- a/library/cpp/openssl/holders/ut/hmac_ut.cpp
+++ b/library/cpp/openssl/holders/ut/hmac_ut.cpp
@@ -1,10 +1,10 @@
-#include "hmac.h"
-
+#include "hmac.h"
+
#include <library/cpp/testing/unittest/registar.h>
-
-Y_UNIT_TEST_SUITE(Hmac) {
- Y_UNIT_TEST(Ctx) {
- NOpenSSL::THmacCtx ctx;
- UNIT_ASSERT(ctx);
- }
-}
+
+Y_UNIT_TEST_SUITE(Hmac) {
+ Y_UNIT_TEST(Ctx) {
+ NOpenSSL::THmacCtx ctx;
+ UNIT_ASSERT(ctx);
+ }
+}
diff --git a/library/cpp/openssl/holders/ut/ya.make b/library/cpp/openssl/holders/ut/ya.make
index 045cdc3566..7c6f550d14 100644
--- a/library/cpp/openssl/holders/ut/ya.make
+++ b/library/cpp/openssl/holders/ut/ya.make
@@ -1,10 +1,10 @@
UNITTEST_FOR(library/cpp/openssl/holders)
-
-OWNER(somov deshevoy)
-
-SRCS(
- evp_ut.cpp
- hmac_ut.cpp
-)
-
-END()
+
+OWNER(somov deshevoy)
+
+SRCS(
+ evp_ut.cpp
+ hmac_ut.cpp
+)
+
+END()
diff --git a/library/cpp/openssl/holders/x509_vfy.cpp b/library/cpp/openssl/holders/x509_vfy.cpp
index 731baa9055..dccd22fbf9 100644
--- a/library/cpp/openssl/holders/x509_vfy.cpp
+++ b/library/cpp/openssl/holders/x509_vfy.cpp
@@ -1,30 +1,30 @@
-#include "x509_vfy.h"
-
-namespace NOpenSSL {
-
- TX509LookupMethod::TX509LookupMethod(
- const char* name,
- int (*newItem) (X509_LOOKUP *ctx),
- void (*free) (X509_LOOKUP *ctx),
- int (*init) (X509_LOOKUP *ctx),
- int (*shutdown) (X509_LOOKUP *ctx),
- X509_LOOKUP_ctrl_fn ctrl,
- X509_LOOKUP_get_by_subject_fn getBySubject,
- X509_LOOKUP_get_by_issuer_serial_fn getByIssuerSerial,
- X509_LOOKUP_get_by_fingerprint_fn getByFingerprint,
- X509_LOOKUP_get_by_alias_fn getByAlias
- )
- : THolder(name)
- {
- X509_LOOKUP_meth_set_new_item(*this, newItem);
- X509_LOOKUP_meth_set_free(*this, free);
- X509_LOOKUP_meth_set_init(*this, init);
- X509_LOOKUP_meth_set_shutdown(*this, shutdown);
- X509_LOOKUP_meth_set_ctrl(*this, ctrl);
- X509_LOOKUP_meth_set_get_by_subject(*this, getBySubject);
- X509_LOOKUP_meth_set_get_by_issuer_serial(*this, getByIssuerSerial);
- X509_LOOKUP_meth_set_get_by_fingerprint(*this, getByFingerprint);
- X509_LOOKUP_meth_set_get_by_alias(*this, getByAlias);
- }
-
-} // namespace NOpenSSL
+#include "x509_vfy.h"
+
+namespace NOpenSSL {
+
+ TX509LookupMethod::TX509LookupMethod(
+ const char* name,
+ int (*newItem) (X509_LOOKUP *ctx),
+ void (*free) (X509_LOOKUP *ctx),
+ int (*init) (X509_LOOKUP *ctx),
+ int (*shutdown) (X509_LOOKUP *ctx),
+ X509_LOOKUP_ctrl_fn ctrl,
+ X509_LOOKUP_get_by_subject_fn getBySubject,
+ X509_LOOKUP_get_by_issuer_serial_fn getByIssuerSerial,
+ X509_LOOKUP_get_by_fingerprint_fn getByFingerprint,
+ X509_LOOKUP_get_by_alias_fn getByAlias
+ )
+ : THolder(name)
+ {
+ X509_LOOKUP_meth_set_new_item(*this, newItem);
+ X509_LOOKUP_meth_set_free(*this, free);
+ X509_LOOKUP_meth_set_init(*this, init);
+ X509_LOOKUP_meth_set_shutdown(*this, shutdown);
+ X509_LOOKUP_meth_set_ctrl(*this, ctrl);
+ X509_LOOKUP_meth_set_get_by_subject(*this, getBySubject);
+ X509_LOOKUP_meth_set_get_by_issuer_serial(*this, getByIssuerSerial);
+ X509_LOOKUP_meth_set_get_by_fingerprint(*this, getByFingerprint);
+ X509_LOOKUP_meth_set_get_by_alias(*this, getByAlias);
+ }
+
+} // namespace NOpenSSL
diff --git a/library/cpp/openssl/holders/x509_vfy.h b/library/cpp/openssl/holders/x509_vfy.h
index b735d8a042..1e186d0865 100644
--- a/library/cpp/openssl/holders/x509_vfy.h
+++ b/library/cpp/openssl/holders/x509_vfy.h
@@ -1,25 +1,25 @@
-#pragma once
-
-#include <contrib/libs/openssl/include/openssl/x509_vfy.h>
-
+#pragma once
+
+#include <contrib/libs/openssl/include/openssl/x509_vfy.h>
+
#include <library/cpp/openssl/holders/holder.h>
-
-namespace NOpenSSL {
-
-class TX509LookupMethod : public THolder<X509_LOOKUP_METHOD, X509_LOOKUP_meth_new, X509_LOOKUP_meth_free, const char*> {
-public:
- TX509LookupMethod(
- const char* name,
- int (*newItem) (X509_LOOKUP *ctx),
- void (*free) (X509_LOOKUP *ctx),
- int (*init) (X509_LOOKUP *ctx),
- int (*shutdown) (X509_LOOKUP *ctx),
- X509_LOOKUP_ctrl_fn ctrl,
- X509_LOOKUP_get_by_subject_fn getBySubject,
- X509_LOOKUP_get_by_issuer_serial_fn getByIssuerSerial,
- X509_LOOKUP_get_by_fingerprint_fn getByFingerprint,
- X509_LOOKUP_get_by_alias_fn getByAlias
- );
-};
-
-} // namespace NOpenSSL
+
+namespace NOpenSSL {
+
+class TX509LookupMethod : public THolder<X509_LOOKUP_METHOD, X509_LOOKUP_meth_new, X509_LOOKUP_meth_free, const char*> {
+public:
+ TX509LookupMethod(
+ const char* name,
+ int (*newItem) (X509_LOOKUP *ctx),
+ void (*free) (X509_LOOKUP *ctx),
+ int (*init) (X509_LOOKUP *ctx),
+ int (*shutdown) (X509_LOOKUP *ctx),
+ X509_LOOKUP_ctrl_fn ctrl,
+ X509_LOOKUP_get_by_subject_fn getBySubject,
+ X509_LOOKUP_get_by_issuer_serial_fn getByIssuerSerial,
+ X509_LOOKUP_get_by_fingerprint_fn getByFingerprint,
+ X509_LOOKUP_get_by_alias_fn getByAlias
+ );
+};
+
+} // namespace NOpenSSL
diff --git a/library/cpp/openssl/holders/ya.make b/library/cpp/openssl/holders/ya.make
index 3a2fbf3ba5..ca5caecb62 100644
--- a/library/cpp/openssl/holders/ya.make
+++ b/library/cpp/openssl/holders/ya.make
@@ -1,16 +1,16 @@
-LIBRARY()
-
-OWNER(somov deshevoy)
-
-PEERDIR(
- contrib/libs/openssl
-)
-
-SRCS(
- bio.cpp
- x509_vfy.cpp
-)
-
-END()
-
-NEED_CHECK()
+LIBRARY()
+
+OWNER(somov deshevoy)
+
+PEERDIR(
+ contrib/libs/openssl
+)
+
+SRCS(
+ bio.cpp
+ x509_vfy.cpp
+)
+
+END()
+
+NEED_CHECK()