[packages/kinetic-cpp-client] - added openssl patch (fix for openssl 1.1+) - added protocol patch (adjust for kinetic-protocol 4)

qboosh qboosh at pld-linux.org
Fri May 22 20:24:20 CEST 2020


commit b948d43ee36880540e3ec76ce1eabb7216f05d79
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri May 22 20:24:49 2020 +0200

    - added openssl patch (fix for openssl 1.1+)
    - added protocol patch (adjust for kinetic-protocol 4)
    - release 5 (rebuild with kinetic-protocol 4 and protobuf 3.11.x)

 kinetic-cpp-client-openssl.patch     | 31 +++++++++++++++++++++++++++++++
 kinetic-cpp-client-protocol.patch    | 22 ++++++++++++++++++++++
 kinetic-cpp-client-system-libs.patch |  2 +-
 kinetic-cpp-client.spec              | 12 ++++++++----
 4 files changed, 62 insertions(+), 5 deletions(-)
---
diff --git a/kinetic-cpp-client.spec b/kinetic-cpp-client.spec
index 90541e5..4152771 100644
--- a/kinetic-cpp-client.spec
+++ b/kinetic-cpp-client.spec
@@ -6,12 +6,14 @@ Summary:	Kinetic C++ client library
 Summary(pl.UTF-8):	Biblioteka kliencka C++ Kinetic
 Name:		kinetic-cpp-client
 Version:	0.1.1
-Release:	4
+Release:	5
 License:	GPL v2+
 Group:		Libraries
 Source0:	https://github.com/Kinetic/kinetic-cpp-client/archive/%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	ac77cc4ebf388e0e1d690317888373e6
 Patch0:		%{name}-system-libs.patch
+Patch1:		%{name}-openssl.patch
+Patch2:		%{name}-protocol.patch
 URL:		https://github.com/Kinetic/kinetic-cpp-client/
 BuildRequires:	cmake >= 2.8.6
 %{?with_apidocs:BuildRequires:	doxygen}
@@ -19,7 +21,7 @@ BuildRequires:	gflags-devel >= 2.0
 BuildRequires:	glog-devel >= 0.3.3
 BuildRequires:	gmock-devel >= 1.6.0
 BuildRequires:	gtest-devel >= 1.6.0
-BuildRequires:	kinetic-protocol >= 3.0.0
+BuildRequires:	kinetic-protocol >= 4.0
 BuildRequires:	libstdc++-devel
 BuildRequires:	openssl-devel >= 1.0.1g
 BuildRequires:	protobuf-devel >= 2.5.0
@@ -41,7 +43,7 @@ Group:		Development/Libraries
 Requires:	%{name} = %{version}-%{release}
 Requires:	libstdc++-devel
 Requires:	openssl-devel
-Requires:	protobuf-devel >= 2.5.0
+%requires_ge	protobuf-devel
 
 %description devel
 Header files for Kinetic C++ client library.
@@ -53,7 +55,7 @@ Pliki nagłówkowe biblioteki klienckiej C++ Kinetic.
 Summary:	Kinetic C++ client API documentation
 Summary(pl.UTF-8):	Dokumentacja API biblioteki klienckiej C++ Kinetic
 Group:		Documentation
-%if "%{_rpmversion}" >= "5"
+%if "%{_rpmversion}" >= "4.6"
 BuildArch:	noarch
 %endif
 
@@ -66,6 +68,8 @@ Dokumentacja API biblioteki klienckiej C++ Kinetic.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %build
 install -d build
diff --git a/kinetic-cpp-client-openssl.patch b/kinetic-cpp-client-openssl.patch
new file mode 100644
index 0000000..7b1c8fe
--- /dev/null
+++ b/kinetic-cpp-client-openssl.patch
@@ -0,0 +1,31 @@
+--- kinetic-cpp-client-0.1.1/src/main/hmac_provider.cc.orig	2014-09-18 02:14:04.000000000 +0200
++++ kinetic-cpp-client-0.1.1/src/main/hmac_provider.cc	2020-05-22 18:07:12.566495617 +0200
+@@ -35,22 +35,21 @@
+ 
+ std::string HmacProvider::ComputeHmac(const Message& message,
+         const std::string& key) const {
+-    HMAC_CTX ctx;
+-    HMAC_CTX_init(&ctx);
+-    HMAC_Init_ex(&ctx, key.c_str(), key.length(), EVP_sha1(), NULL);
++    HMAC_CTX *ctx = HMAC_CTX_new();
++    HMAC_Init_ex(ctx, key.c_str(), key.length(), EVP_sha1(), NULL);
+ 
+     if (message.commandbytes().length() != 0) {
+         uint32_t message_length_bigendian = htonl(message.commandbytes().length());
+-        HMAC_Update(&ctx, reinterpret_cast<unsigned char *>(&message_length_bigendian),
++        HMAC_Update(ctx, reinterpret_cast<unsigned char *>(&message_length_bigendian),
+             sizeof(uint32_t));
+-        HMAC_Update(&ctx, reinterpret_cast<const unsigned char *>(message.commandbytes().c_str()),
++        HMAC_Update(ctx, reinterpret_cast<const unsigned char *>(message.commandbytes().c_str()),
+             message.commandbytes().length());
+     }
+ 
+     unsigned char result[SHA_DIGEST_LENGTH];
+     unsigned int result_length = SHA_DIGEST_LENGTH;
+-    HMAC_Final(&ctx, result, &result_length);
+-    HMAC_CTX_cleanup(&ctx);
++    HMAC_Final(ctx, result, &result_length);
++    HMAC_CTX_free(ctx);
+ 
+     return std::string(reinterpret_cast<char *>(result), result_length);
+ }
diff --git a/kinetic-cpp-client-protocol.patch b/kinetic-cpp-client-protocol.patch
new file mode 100644
index 0000000..5cfa3b1
--- /dev/null
+++ b/kinetic-cpp-client-protocol.patch
@@ -0,0 +1,22 @@
+--- kinetic-cpp-client-0.1.1/src/main/nonblocking_kinetic_connection.cc.orig	2014-09-18 02:14:04.000000000 +0200
++++ kinetic-cpp-client-0.1.1/src/main/nonblocking_kinetic_connection.cc	2020-05-22 19:24:30.291370906 +0200
+@@ -589,7 +589,7 @@
+     msg->set_authtype(Message_AuthType_HMACAUTH);
+     unique_ptr<Command> request = NewCommand(Command_MessageType_SETUP);
+ 
+-    request->mutable_body()->mutable_setup()->set_firmwaredownload(true);
++    request->mutable_body()->mutable_setup()->set_setupoptype(com::seagate::kinetic::client::proto::Command_Setup::FIRMWARE_SETUPOP);
+ 
+     unique_ptr<SimpleHandler> handler(new SimpleHandler(callback));
+     return service_->Submit(move(msg), move(request), new_firmware, move(handler));
+--- kinetic-cpp-client-0.1.1/src/test/nonblocking_kinetic_connection_test.cc.orig	2014-09-18 02:14:04.000000000 +0200
++++ kinetic-cpp-client-0.1.1/src/test/nonblocking_kinetic_connection_test.cc	2020-05-22 19:42:39.225471644 +0200
+@@ -381,7 +381,7 @@
+     connection_.UpdateFirmware(make_shared<string>("the new firmware"), NULL);
+ 
+     EXPECT_EQ(Command_MessageType_SETUP, message.header().messagetype());
+-    EXPECT_EQ(true, message.body().setup().firmwaredownload());
++    EXPECT_EQ(com::seagate::kinetic::client::proto::Command_Setup::FIRMWARE_SETUPOP, message.body().setup().setupoptype());
+ }
+ 
+ TEST_F(NonblockingKineticConnectionTest, SetACLsBuildsCorrectMessage) {
diff --git a/kinetic-cpp-client-system-libs.patch b/kinetic-cpp-client-system-libs.patch
index 8548edf..691cd30 100644
--- a/kinetic-cpp-client-system-libs.patch
+++ b/kinetic-cpp-client-system-libs.patch
@@ -94,7 +94,7 @@
 -    CONFIGURE_COMMAND ../protoc/configure --prefix=${EXTERNAL_PREFIX}/host --enable-static
 -)
 -
-+add_library(gmock STATIC /usr/src/gmock/src/gmock-all.cc)
++#add_library(gmock STATIC /usr/src/gmock/src/gmock-all.cc)
  # Protobuf code generation rules
 -set(PROTOC_PATH "${PREFIX}/host/bin/protoc")
 -set(PROTO_DIR "${CMAKE_BINARY_DIR}/vendor/src/kinetic-proto")
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kinetic-cpp-client.git/commitdiff/b948d43ee36880540e3ec76ce1eabb7216f05d79



More information about the pld-cvs-commit mailing list