Skip to content

Commit

Permalink
Merge pull request #17 from eu-digital-identity-wallet/develop
Browse files Browse the repository at this point in the history
use subjectDistinguishedName for reader common name
  • Loading branch information
phisakel authored Feb 6, 2024
2 parents 268ef13 + e3b80a4 commit 332031d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/MdocDataTransfer18013/MdocHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public class MdocHelpers {
var params: [String: Any] = [UserRequestKeys.valid_items_requested.rawValue: validRequestItems, UserRequestKeys.error_items_requested.rawValue: errorRequestItems]
if let docR = deviceRequest.docRequests.first {
let mdocAuth = MdocReaderAuthentication(transcript: sessionEncryption.transcript)
if let readerAuthRawCBOR = docR.readerAuthRawCBOR, let certData = docR.readerCertificate, let x509 = try? X509Certificate(der: certData), let issName = x509.issuerDistinguishedName, let (b,reasonFailure) = try? mdocAuth.validateReaderAuth(readerAuthCBOR: readerAuthRawCBOR, readerAuthCertificate: certData, itemsRequestRawData: docR.itemsRequestRawData!, rootCerts: iaca) {
if let readerAuthRawCBOR = docR.readerAuthRawCBOR, let certData = docR.readerCertificate, let x509 = try? X509Certificate(der: certData), let issName = x509.subjectDistinguishedName, let (b,reasonFailure) = try? mdocAuth.validateReaderAuth(readerAuthCBOR: readerAuthRawCBOR, readerAuthCertificate: certData, itemsRequestRawData: docR.itemsRequestRawData!, rootCerts: iaca) {
params[UserRequestKeys.reader_certificate_issuer.rawValue] = MdocHelpers.getCN(from: issName)
params[UserRequestKeys.reader_auth_validated.rawValue] = b
if let reasonFailure { params[UserRequestKeys.reader_certificate_validation_message.rawValue] = reasonFailure }
Expand Down

0 comments on commit 332031d

Please sign in to comment.