Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libsexpp updated to 0.8.8 #2242

Merged
merged 3 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions src/lib/types.h
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -71,9 +71,6 @@ class id_str_pair {
static int lookup(const id_str_pair pair[],
const std::vector<uint8_t> &bytes,
int notfound = 0);
static int lookup(const id_str_pair pair[],
const std::basic_string<uint8_t> &bytes,
int notfound = 0);
};

/** pgp_fingerprint_t */
Expand Down
17 changes: 1 addition & 16 deletions src/lib/utils.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -63,18 +63,3 @@ id_str_pair::lookup(const id_str_pair pair[], const std::vector<uint8_t> &bytes,
}
return notfound;
}

int
id_str_pair::lookup(const id_str_pair pair[],
const std::basic_string<uint8_t> &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;
}
8 changes: 4 additions & 4 deletions src/librekey/key_store_g10.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -311,12 +311,12 @@

const auto &bytes = data->get_string();
pgp_curve_t curve = static_cast<pgp_curve_t>(
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());

Check warning on line 319 in src/librekey/key_store_g10.cpp

View check run for this annotation

Codecov / codecov/patch

src/librekey/key_store_g10.cpp#L319

Added line #L319 was not covered by tests
return false;
}

Expand Down Expand Up @@ -807,7 +807,7 @@

auto & alg_bt = alg_s_exp->sexp_string_at(0)->get_string();
pgp_pubkey_alg_t alg = static_cast<pgp_pubkey_alg_t>(
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());
Expand Down
Loading