Skip to content

Change SID/MID feedback signature - #87

Open
lauris71 wants to merge 81 commits into
open-eid:masterfrom
lauris71:sid2
Open

Change SID/MID feedback signature#87
lauris71 wants to merge 81 commits into
open-eid:masterfrom
lauris71:sid2

Conversation

@lauris71

Copy link
Copy Markdown
Contributor

Changed SID/MID feedback signature to allow Qr code display and possibly other variants

Signed-off-by: Lauris Kaplinski lauris@raulwalter.com

Lauris Kaplinski and others added 30 commits January 9, 2026 11:12
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>
Comment thread cdoc/CDoc2Reader.cpp Fixed
Comment thread cdoc/CDoc2Reader.cpp Fixed
Comment thread cdoc/NetworkBackend.cpp Fixed
Comment thread cdoc/NetworkBackend.cpp
picojson::array inter_arr = {
picojson::value(inter)
};
//std::string inter_str = picojson::value(inter_arr).serialize();
Comment thread cdoc/CDoc2Reader.cpp Fixed
Comment thread cdoc/CDoc2Reader.cpp
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);
Comment thread cdoc/CDoc2Reader.cpp Fixed
Comment thread cdoc/CDoc2Reader.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 thread cdoc/Crypto.cpp
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;
}
}
Comment thread cdoc/NetworkBackend.cpp
// static_asserts will catch it explicitly.
static constexpr std::string_view
hashAlgorithmToSidMidName(libcdoc::CryptoBackend::HashAlgorithm algo) noexcept
hashAlgorithmToSidName(libcdoc::CryptoBackend::HashAlgorithm algo) noexcept
Comment thread cdoc/NetworkBackend.cpp
dst.cert = getJsonString(picojson::value(cert_obj), "value", result);
if (result != OK) return result;
} else {
std::string str = getJsonString(rsp_json, "result", result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants