Change SID/MID feedback signature - #87
Open
lauris71 wants to merge 81 commits into
Open
Conversation
Signed-off-by: Lauris Kaplinski <lauris@raulwalter.com>
Signed-off-by: Lauris Kaplinski <lauris@raulwalter.com>
Co-authored-by: Raul Metsma <raul@metsma.ee>
Co-authored-by: Raul Metsma <raul@metsma.ee>
Co-authored-by: Raul Metsma <raul@metsma.ee>
Co-authored-by: Raul Metsma <raul@metsma.ee>
Co-authored-by: Raul Metsma <raul@metsma.ee>
…ey dump and TLS diabling
# Conflicts: # cdoc/XmlReader.cpp # test/CMakeLists.txt # test/libcdoc_boost.cpp
| picojson::array inter_arr = { | ||
| picojson::value(inter) | ||
| }; | ||
| //std::string inter_str = picojson::value(inter_arr).serialize(); |
| std::string relyingPartyName = conf->getValue(Configuration::SID_DOMAIN, Configuration::RP_NAME); | ||
| SIDSigner signer(url, relyingPartyUUID, relyingPartyName, rcpt_id, network); | ||
| result = signer.generateTickets(tickets, shares); | ||
| SIDSigner signer(rp_url, session, rcpt_id, network); |
added 6 commits
August 5, 2026 09:51
# Conflicts: # cdoc/CDoc2Writer.cpp # test/CMakeLists.txt # test/libcdoc_boost.cpp
| MIDSigner signer(url, relyingPartyUUID, relyingPartyName, phone, rcpt_id, network); | ||
| result = signer.generateTickets(tickets, shares); | ||
| } else { | ||
| MIDSigner signer(rp_url, phone, session, rcpt_id, network); |
Comment on lines
+78
to
+95
| switch (algo) { | ||
| case SignatureAlgorithm::RSASSA_PSS_SHA256: { | ||
| // The provider's one-shot EVP_PKEY_verify for RSA requires the | ||
| // input to be the message digest already, so hash `data` first. | ||
| uint8_t md_value[EVP_MAX_MD_SIZE]; | ||
| unsigned int md_len = 0; | ||
| if (EVP_Digest(data.data(), data.size(), md_value, &md_len, EVP_sha256(), nullptr) != 1) | ||
| return false; | ||
| if (EVP_PKEY_verify_init(ctx.get()) != 1) | ||
| return false; | ||
| if (EVP_PKEY_CTX_set_rsa_padding(ctx.get(), RSA_PKCS1_PSS_PADDING) <= 0 || | ||
| EVP_PKEY_CTX_set_signature_md(ctx.get(), EVP_sha256()) <= 0 || | ||
| EVP_PKEY_CTX_set_rsa_mgf1_md(ctx.get(), EVP_sha256()) <= 0 || | ||
| EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx.get(), RSA_PSS_SALTLEN_DIGEST) <= 0) | ||
| return false; | ||
| return EVP_PKEY_verify(ctx.get(), signature.data(), signature.size(), md_value, md_len) == 1; | ||
| } | ||
| } |
| // static_asserts will catch it explicitly. | ||
| static constexpr std::string_view | ||
| hashAlgorithmToSidMidName(libcdoc::CryptoBackend::HashAlgorithm algo) noexcept | ||
| hashAlgorithmToSidName(libcdoc::CryptoBackend::HashAlgorithm algo) noexcept |
| dst.cert = getJsonString(picojson::value(cert_obj), "value", result); | ||
| if (result != OK) return result; | ||
| } else { | ||
| std::string str = getJsonString(rsp_json, "result", result); |
added 5 commits
August 7, 2026 22:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed SID/MID feedback signature to allow Qr code display and possibly other variants
Signed-off-by: Lauris Kaplinski lauris@raulwalter.com