Skip to content

Commit 889a3ab

Browse files
committed
enforce doctype match for mdoc pex
Signed-off-by: kenkosmowski <ken.kosmowski@gmx.de>
1 parent 2605ff0 commit 889a3ab

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
@@ -170,7 +170,8 @@ private async Task<Option<IEnumerable<ICredential>>> GetMatchingCredentials(
170170
var filteredMdocRecords = mdocRecords.OnSome(records => records
171171
.Where(record =>
172172
{
173-
return record.Mdoc.IssuerSigned.IssuerAuth.ProtectedHeaders.Value.TryGetValue(new CoseLabel(1), out var alg)
173+
return record.DocType == inputDescriptor.Id
174+
&& record.Mdoc.IssuerSigned.IssuerAuth.ProtectedHeaders.Value.TryGetValue(new CoseLabel(1), out var alg)
174175
&& supportedFormatSigningAlgorithms.Match(
175176
formats => formats.MDocFormat?.Alg?.Contains(alg.ToString()) ?? true,
176177
() => inputDescriptor.Formats?.MDocFormat?.Alg?.Contains(alg.ToString()) ?? true)

0 commit comments

Comments
 (0)