From 16c98748d0068e1f729017ae8530a5004760c7ef Mon Sep 17 00:00:00 2001 From: "Maxim [maxirmx] Samsonov" Date: Sun, 16 Jun 2024 23:48:21 +0300 Subject: [PATCH 1/3] libsexpp version bump to 0.8.8 (#2241) --- src/libsexpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsexpp b/src/libsexpp index e265f6370d..7197ff26ea 160000 --- a/src/libsexpp +++ b/src/libsexpp @@ -1 +1 @@ -Subproject commit e265f6370dd750b4f23ffbfcbb477514f7c2a517 +Subproject commit 7197ff26eae37cc89c0b1eb88c365ca468ecd151 From 3ff0ad6e88928d861ebfba4dbe86b663faf09918 Mon Sep 17 00:00:00 2001 From: "Maxim [maxirmx] Samsonov" Date: Mon, 17 Jun 2024 10:05:39 +0300 Subject: [PATCH 2/3] Fixed MaxOS 13 python update issue --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 024becf28d..80ce788b9d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -104,7 +104,7 @@ jobs: - name: Install dependencies run: | - rm -f '/usr/local/bin/2to3' 'usr/local/bin/2to3-3.12' '/usr/local/bin/idle3' '/usr/local/bin/idle3.12' \ + rm -f '/usr/local/bin/2to3' '/usr/local/bin/2to3-3.12' '/usr/local/bin/idle3' '/usr/local/bin/idle3.12' \ '/usr/local/bin/pydoc3' '/usr/local/bin/pydoc3.12' '/usr/local/bin/python3' '/usr/local/bin/python3-config' \ '/usr/local/bin/python3.12' '/usr/local/bin/python3.12-config' brew bundle From e0790a2c4ff8e09d52522785cec1c9db23d304ac Mon Sep 17 00:00:00 2001 From: Maxim Samsonov Date: Wed, 19 Jun 2024 16:52:08 +0300 Subject: [PATCH 3/3] Removed lookup against basic_string --- src/lib/types.h | 5 +---- src/lib/utils.cpp | 17 +---------------- src/librekey/key_store_g10.cpp | 8 ++++---- src/libsexpp | 2 +- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/lib/types.h b/src/lib/types.h index f0c25d3d6b..a7eac3a121 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2023, [Ribose Inc](https://www.ribose.com). + * Copyright (c) 2017-2024, [Ribose Inc](https://www.ribose.com). * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, @@ -71,9 +71,6 @@ class id_str_pair { static int lookup(const id_str_pair pair[], const std::vector &bytes, int notfound = 0); - static int lookup(const id_str_pair pair[], - const std::basic_string &bytes, - int notfound = 0); }; /** pgp_fingerprint_t */ diff --git a/src/lib/utils.cpp b/src/lib/utils.cpp index 3c6216c604..fd526379f1 100644 --- a/src/lib/utils.cpp +++ b/src/lib/utils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, [Ribose Inc](https://www.ribose.com). + * Copyright (c) 2021, 2024 [Ribose Inc](https://www.ribose.com). * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,18 +63,3 @@ id_str_pair::lookup(const id_str_pair pair[], const std::vector &bytes, } return notfound; } - -int -id_str_pair::lookup(const id_str_pair pair[], - const std::basic_string &bytes, - int notfound) -{ - while (pair && pair->str) { - if ((strlen(pair->str) == bytes.size()) && - !memcmp(pair->str, bytes.data(), bytes.size())) { - return pair->id; - } - pair++; - } - return notfound; -} diff --git a/src/librekey/key_store_g10.cpp b/src/librekey/key_store_g10.cpp index e646f02fb2..2113686603 100644 --- a/src/librekey/key_store_g10.cpp +++ b/src/librekey/key_store_g10.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2022, [Ribose Inc](https://www.ribose.com). + * Copyright (c) 2017-2024, [Ribose Inc](https://www.ribose.com). * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -311,12 +311,12 @@ read_curve(const sexp_list_t *list, const std::string &name, pgp_ec_key_t &key) const auto &bytes = data->get_string(); pgp_curve_t curve = static_cast( - id_str_pair::lookup(g10_curve_aliases, data->get_string(), PGP_CURVE_UNKNOWN)); + id_str_pair::lookup(g10_curve_aliases, (const char *) bytes.data(), PGP_CURVE_UNKNOWN)); if (curve != PGP_CURVE_UNKNOWN) { key.curve = curve; return true; } - RNP_LOG("Unknown curve: %.*s", (int) bytes.size(), (char *) bytes.data()); + RNP_LOG("Unknown curve: %.*s", (int) bytes.size(), (const char *) bytes.data()); return false; } @@ -807,7 +807,7 @@ g23_parse_seckey(pgp_key_pkt_t &seckey, auto & alg_bt = alg_s_exp->sexp_string_at(0)->get_string(); pgp_pubkey_alg_t alg = static_cast( - id_str_pair::lookup(g10_alg_aliases, alg_bt.c_str(), PGP_PKA_NOTHING)); + id_str_pair::lookup(g10_alg_aliases, (const char *) alg_bt.data(), PGP_PKA_NOTHING)); if (alg == PGP_PKA_NOTHING) { RNP_LOG( "Unsupported algorithm: '%.*s'", (int) alg_bt.size(), (const char *) alg_bt.data()); diff --git a/src/libsexpp b/src/libsexpp index 7197ff26ea..46744a14ff 160000 --- a/src/libsexpp +++ b/src/libsexpp @@ -1 +1 @@ -Subproject commit 7197ff26eae37cc89c0b1eb88c365ca468ecd151 +Subproject commit 46744a14ffc235330bb99cebfaf294829c31bba4