Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Developer Beta 3 build. #46

Merged
merged 1 commit into from
Jul 31, 2020
Merged

Update to Developer Beta 3 build. #46

merged 1 commit into from
Jul 31, 2020

Conversation

Lukasa
Copy link
Collaborator

@Lukasa Lukasa commented Jul 23, 2020

No description provided.

@Lukasa
Copy link
Collaborator Author

Lukasa commented Jul 23, 2020

The API failure note is irrelevant: we have not shipped the error that is being removed in this patch.

Copy link
Contributor

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good from a Swift point of view.

#if (os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) && CRYPTO_IN_SWIFTPM && !CRYPTO_IN_SWIFTPM_FORCE_BUILD_API
@_exported import CryptoKit
#else
import Foundation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's being used from Foundation here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing, but this is a pretty ordinary starting stanza and I'm loathe to change it. 😉


let sig = ASN1.ECDSASignature(r: r, s: s)
var serializer = ASN1.Serializer()
try! serializer.serialize(sig)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the ! okay here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ! is ok for two reasons:

  1. This is a var, so we can't throw even if we wanted to: crashing is our only accessible error handling mode
  2. This is not being computed over arbitrary data but previously-validated data, so it should not be possible for this to fail. If it did, it would be our error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explainer!

@Lukasa Lukasa merged commit d82f7d8 into apple:master Jul 31, 2020
@Lukasa Lukasa deleted the cb-seed-3 branch July 31, 2020 18:50
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