Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dnadoba committed Feb 2, 2023
1 parent f153e0b commit c33a826
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct CMSSignedData: DERImplicitlyTaggable, Hashable {

// TODO: support multiple signer infos. For this we need to validate that the binary representation of each element is lexicographically sorted.
guard signerInfos.count <= 1 else {
throw Error.multipleDigestAlgorithmsAreNotSupportedYet
throw Error.multipleSignerInfosAreNotSupportedYet
}

return .init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import SwiftASN1
/// ```
enum CMSSignerIdentifier: DERParseable, DERSerializable, Hashable {

private static let subjectKeyIdentifierIdentifier = ASN1Identifier(tagWithNumber: 0, tagClass: .contextSpecific)
private static let skiIdentifier = ASN1Identifier(tagWithNumber: 0, tagClass: .contextSpecific)

case issuerAndSerialNumber(CMSIssuerAndSerialNumber)
case subjectKeyIdentifier(Certificate.Extensions.SubjectKeyIdentifier)
Expand All @@ -32,8 +32,8 @@ enum CMSSignerIdentifier: DERParseable, DERSerializable, Hashable {
case CMSIssuerAndSerialNumber.defaultIdentifier:
self = try .issuerAndSerialNumber(.init(derEncoded: node))

case Self.subjectKeyIdentifierIdentifier:
self = try .subjectKeyIdentifier(.init(keyIdentifier: .init(derEncoded: node, withIdentifier: Self.subjectKeyIdentifierIdentifier)))
case Self.skiIdentifier:
self = try .subjectKeyIdentifier(.init(keyIdentifier: .init(derEncoded: node, withIdentifier: Self.skiIdentifier)))

default:
throw ASN1Error.invalidASN1Object
Expand All @@ -46,7 +46,7 @@ enum CMSSignerIdentifier: DERParseable, DERSerializable, Hashable {
try issuerAndSerialNumber.serialize(into: &coder)

case .subjectKeyIdentifier(let subjectKeyIdentifier):
try subjectKeyIdentifier.keyIdentifier.serialize(into: &coder, withIdentifier: Self.subjectKeyIdentifierIdentifier)
try subjectKeyIdentifier.keyIdentifier.serialize(into: &coder, withIdentifier: Self.skiIdentifier)

}
}
Expand Down

0 comments on commit c33a826

Please sign in to comment.