Skip to content

Commit cae3635

Browse files
authored
enforce doctype match for mdoc pex (#336)
Signed-off-by: kenkosmowski <ken.kosmowski@gmx.de>
1 parent fb73d3f commit cae3635

File tree

1 file changed

+2
-1
lines changed
  • src/WalletFramework.Oid4Vc/Oid4Vp/PresentationExchange/Services

1 file changed

+2
-1
lines changed

src/WalletFramework.Oid4Vc/Oid4Vp/PresentationExchange/Services/PexService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ private async Task<Option<IEnumerable<ICredential>>> GetMatchingCredentials(
182182
var filteredMdocRecords = mdocRecords.OnSome(records => records
183183
.Where(record =>
184184
{
185-
return record.Mdoc.IssuerSigned.IssuerAuth.ProtectedHeaders.Value.TryGetValue(new CoseLabel(1), out var alg)
185+
return record.DocType == inputDescriptor.Id
186+
&& record.Mdoc.IssuerSigned.IssuerAuth.ProtectedHeaders.Value.TryGetValue(new CoseLabel(1), out var alg)
186187
&& supportedFormatSigningAlgorithms.Match(
187188
formats => formats.MDocFormat?.Alg?.Contains(alg.ToString()) ?? true,
188189
() => inputDescriptor.Formats?.MDocFormat?.Alg?.Contains(alg.ToString()) ?? true)

0 commit comments

Comments
 (0)