]> git.pld-linux.org Git - packages/kinetic-cpp-client.git/commitdiff
- added openssl patch (fix for openssl 1.1+)
authorJakub Bogusz <qboosh@pld-linux.org>
Fri, 22 May 2020 18:24:49 +0000 (20:24 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Fri, 22 May 2020 18:24:49 +0000 (20:24 +0200)
- 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 [new file with mode: 0644]
kinetic-cpp-client-protocol.patch [new file with mode: 0644]
kinetic-cpp-client-system-libs.patch
kinetic-cpp-client.spec

diff --git a/kinetic-cpp-client-openssl.patch b/kinetic-cpp-client-openssl.patch
new file mode 100644 (file)
index 0000000..7b1c8fe
--- /dev/null
@@ -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 (file)
index 0000000..5cfa3b1
--- /dev/null
@@ -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) {
index 8548edf8e4df7b60a2ab5cd751bc7f0883a6e80e..691cd30a016c1b440e572e21e4b33764d7eb6942 100644 (file)
@@ -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")
index 90541e5449af6b161fd00395813a94b17f84f287..4152771244bdd4e11b038c8eb3a84c9865d0f752 100644 (file)
@@ -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
This page took 0.093292 seconds and 4 git commands to generate.