Commit Graph
98 Commits
Author SHA1 Message Date
Rick Newton-Rogers b65ee9bc34 add .editorconfig file (#80) 2024-11-14 15:59:53 +00:00
Franz Busch 892b611455 [CI] Enable Windows CI (#77)
# Motivation

We want to make sure our packages build on all supported platforms.

# Modification

This PR enabled the Windows CI.

# Result

Better test coverage in our package.
2024-10-23 10:43:11 +01:00
Peter Adams 8f3abb33b0 Remove script for updating contributors list (#78)
Motivation:

Contributors list is nolonger being maintained
as it can be trivially derived from git history.

Modifications:

Remove script for updating contributors list.

Result:

One fewer script
2024-10-22 16:38:52 +01:00
Rick Newton-Rogers 81ee7dc715 CI: concurrency=complete require-explicit-sendable (#76)
CI: concurrency=complete require-explicit-sendable

Motivation:

Adopt `-Xswiftc -strict-concurrency=complete -Xswiftc
-require-explicit-sendable` in CI to lock-in concurrency-safety wins.

Modifications:

Added strict flags to pull request and scheduled GHA CI on Swift 6.0.

Result:

CI should ensure we don't regress data-race safety on Swift 6.0.
2024-10-17 09:36:37 +01:00
Rick Newton-Rogers b4353f4ec9 Remove legacy CI docker/script files (#75)
Motivation:

Now that we have cut over to GitHub Actions we can remove files
supporting the old workflow.

Modifications:

Remove docker and stubbed-out script files.

Result:

Nothing should change because GHA is now used as CI.
2024-10-15 14:32:08 +01:00
Rick Newton-Rogers d016643222 Migrate to GitHub Actions reusable workflows (2) (#74)
* Prepare repo for new GHA checks

Motivation:

Migrate to GitHub Actions reusable workflows (2)

Modifications:

* Add GHA PR label checks
* Add GHA benchmarks checks
* Satisfy soundness checks

Result:

New soundness checks should be green and ready for adoption

* review comments
2024-10-15 13:04:58 +01:00
Cory Benfield 7faebca1ea Drop Swift 5.8 (#69)
We no longer support Swift 5.8, so let's wave it goodbye
1.3.0
2024-10-14 11:13:45 +00:00
Peter AdamsandCory Benfield aeb9c927fd More Sendability annotiations (#72)
Motivation:

Completing annotations helps with coverage for consuming projects.

Modifications:

Mark more things and Sendable or not.

Result:

Consuming libraries more likely to get correct usage.

Co-authored-by: Cory Benfield <lukasa@apple.com>
2024-10-14 10:49:11 +00:00
Peter Adams 9969712080 yamllint fixes (#73) 2024-10-14 11:43:24 +01:00
Rick Newton-RogersandFranz Busch 381bf08f8f Migrate to GitHub Actions reusable workflows (1) (#70)
* Migrate to GitHub Actions reusable workflows (1)

Motivation:

Migrate to GitHub Actions reusable workflows whilst keeping CI green.

Modifications:

As the first step in migrating to use GitHub actions this PR provides
the workflows which will be used in the future, at first in disabled
state so that we can keep CI green during the changeover.

Result:

Once this PR is merged we can:
* Enable the new CI
* In a future PR neutralize the old CI scripts
* Disable the old CI via GitHub
* In a future PR Delete the old CI scripts

* add scheduled GHA CI

* Update .github/workflows/pull_request.yml

Co-authored-by: Franz Busch <privat@franz-busch.de>

* review comments

---------

Co-authored-by: Franz Busch <privat@franz-busch.de>
2024-10-10 10:46:42 +01:00
aryan-25 a6cdd4d974 Add support for CRLF line endings to PEMDocument (#68)
* Add support for CRLF line endings to `PEMDocument`

* Remove `lineEnding` as an argument and instead detect line ending automatically.

* Fix description

* Refactor
2024-10-09 10:38:02 +01:00
1a80ac7e4b Update Swift targets to enable ExistentialAny (#65)
Motivation:

With the advent of Upcoming Feature Flags https://www.swift.org/blog/using-upcoming-feature-flags/ ,
we should make it a one-liner to enable feature flags.

As a follow-on to PR 63, we should enable the ExistentialAny feature flag, as
the code currently complies, and we may as well help flag any unintentional
regressions to that behavior.

Modifications:

Update Package.swift to allow for one-liner additions of new feature flags.
Enable the upcoming feature flag ExistentialAny

Result:

Better confidence that we don't break downstreams that compile this code with
ExistentialAny enabled.
Makes it (slightly) easier for future authors to modify the set of enabled feature flags.

Co-authored-by: Paul Seligman <pseligman@apple.com>
Co-authored-by: Cory Benfield <lukasa@apple.com>
2024-09-19 10:38:22 +01:00
Cory Benfield 64d3644b6b Update nightly benchmark thresholds (#67) 2024-09-19 10:41:29 +02:00
LamTrinh.Dev 60b2af8382 Update link for swift-docc-plugin repository. (#64) 2024-09-17 03:18:11 -07:00
Paul SeligmanandPaul Seligman dd8cacc283 Update code to compile without issue when ExistentialAny enabled (#63)
Motivation:

We should feel confident that we compile clean when built in an environment
that has enabled upcoming Swift features.

When compiling swift-asn1 specifying `.enableUpcomingFeature("ExistentialAny")`
there are some minor warnings emitted by ASN1.swift.

Modifications:

Minor code changes to address surfaced warnings

Result:

Better confidence that we don't break downstreams that compile this code with
these upcoming features enabled.

Co-authored-by: Paul Seligman <pseligman@apple.com>
2024-09-13 23:59:52 -07:00
LamTrinh.Dev cc2468226c Correct the link of sswg-security at SECURITY.md (#62) 2024-09-09 02:43:24 -07:00
Franz Busch 7b4b3c7a81 Add release.yml (#61) 2024-09-06 13:10:28 +01:00
Peter Adams 544ffa8eae Use filePath for test assert location (#59)
Motivation:

This is consistent with what underlying assert does.
Swift 6 warns about this mismatch

Modifications:

Use filePath for test assert location

Result:

Consistency in test assert location reporting
2024-08-12 16:08:42 +01:00
Alex Hoppen df5d2fcd22 Update swift-syntax link to swiftlang/swift-syntax (#57) 1.2.0 2024-06-25 07:51:02 -07:00
Clinton Nkwocha 41bee14cff Add rawFractionalSeconds property to GeneralizedTime (#53)
Motivation:

There is a possible overflow when computing a `Double` value for `fractionalSeconds` from an `ArraySlice` of bytes. Hence, access to this original `ArraySlice` is necessary.

Modifications:

- Add `rawFractionalSeconds` property to `GeneralizedTime`.
- Add a new `internal init` to `GeneralizedTime` that accepts `rawFractionalSeconds` instead of `fractionalSeconds` and generates the later from the former.
- Adjust the algorithm for computing `fractionalSeconds`, from a mathematical to a `String` computation. This is due to the precision mismatch between the mathematical computation and the native `Double` computation. This issue, which previously did not surface, now does, due to the newly included round-trip conversion from `fractionalSeconds` to `rawFractionalSeconds`.

Result:

- The `rawFractionalSeconds` property now provides the original `ArraySlice` from which `fractionalSeconds` was computed.
- `GeneralizedTime` can now compute `fractionalSeconds` from the provided `rawFractionalSeconds`.
2024-06-19 08:26:50 -07:00
aryan-25andCory Benfield e61ef9579a Add initializers for ASN1ObjectIdentifier (#56)
* Add initializers for ASN1ObjectIdentifier

* Added comments to public symbols. Updated error name.

* Add new Substring initializer. Refactor UInt Collection initializer.

---------

Co-authored-by: Cory Benfield <lukasa@apple.com>
2024-06-18 06:18:58 -07:00
Neil Jones 77e4ab7683 add support for riscv64 (#55) 2024-06-17 12:44:59 -07:00
Cory Benfield 9702323ae1 Swift 6 preparedness (#54)
Motivation

We should feel confident that we compile clean under the strict
checks of Swift 6. As this is a data-processing-only framework
it's not a surprise that it turns out to be fine, but this patch
adds the necessary docker-compose steps to ensure it continues
to work.

Modifications

- Add docker-compose file for Swift 6 nightlies
- Extend docker-compose to pass explicit sendable and strict
    concurrency checks
- Add those checks to 6.0 and main nightlies

Result

Better confidence that we don't break our downstreams in Swift 6
support.
2024-06-10 07:20:20 +01:00
George Barnett 7b2855eb0a Raise minimum Swift version to 5.8 (#51)
* Raise minimum Swift version to 5.8

* Update benchmark names
2024-03-11 10:04:27 +00:00
Saleem Abdulrasool 10c2f6a364 build: simplify the build rules (NFC) (#48)
Swift requires CMake 3.19.x to build.  Update the minimum supported
CMake to allow us to simplify the build rules somewhat by removing the
workarounds for older releases.  Additionally, re-order and use
straightline configuration over conditional paths.
2023-11-30 18:06:27 -08:00
David Nadoba 8c262d5e58 Add benchmarks (#46) 2023-10-25 11:17:29 +01:00
Yim Lee c7e239b5c1 Remove note from README about API instability (#45)
I think we can remove that note now that the library has 1.0.0 tag.
1.1.0
2023-10-13 08:59:07 +01:00
Rick Newton-Rogers 3664efa98b Add CI pipeline for Swift 5.10 (#43)
Motivation:

Now that Swift 5.9 is GM we should update the CI pipelines

Modifications:

* Add a 5.10 nightly docker compose file
* Update the 5.9 compose file to stop using nightlies

Result:

Remove add CI support for 5.10
2023-10-04 14:50:23 +01:00
David Zech 28d0e0717f Add support for parsing BER (#42) 2023-10-02 14:42:33 +01:00
David Nadoba 1ffc413e91 Update to swift-format 509.0.0 (#41) 2023-09-28 19:04:01 +02:00
David Nadoba 12c24ff59d Support multi PEM parsing and speed up PEM parsing in general (#39)
* Multi PEM support

* Multi PEM support

* swift-format

* Apply review feedback
1.0.0-beta.2 1.0.0
2023-09-18 03:20:51 -07:00
David Nadoba 49557d7f0a Fix docs: constructed is no longer part of ASN1Identifier (#40) 2023-09-15 18:11:12 +01:00
David Nadoba d5636be054 remove outdated TODO (#38) 2023-08-25 10:50:10 +01:00
David Nadoba ef712c4268 Remove deprecated API (#37) 1.0.0-beta.1 2023-08-22 11:08:52 +01:00
David Nadoba ce1faa434b Make ASN1ObjectIdentifiers internal representation be the encoded form (#36)
* Make `ASN1ObjectIdentifier`s internal representation be the encoded form

* validate during initialisation

* swift-format

* formatting
2023-08-17 15:53:25 +01:00
David Nadoba 43e0170e65 Adopt apple/swift-format (#35)
* default swift-format configuration

* Adopt `apple/swift-format`

* Fix soundness.sh

* Fix linting warnings

* update license header

* Apply review comments
2023-08-11 09:42:48 +01:00
David Nadoba 4758353894 Support macOS 10.14.x/iOS 12.x and older again (#34)
* Support macOS 10.14.x/iOS 12.x and older again

* Revert "Support macOS 10.14.x/iOS 12.x and older again"

This reverts commit 6eeba0327f.

* Erase concrete type manually
0.10.0
2023-07-03 10:25:35 +01:00
David Nadoba 0c33f188a8 Make IntegerBytesCollection conditionally Sendable (#33) 2023-06-30 12:09:52 +01:00
David Nadoba 8dd3d3192f Add method to lazily parse a SET from a ASN1Node (#32)
### Motiviation
We want reduce allocations in swift-certificates and need a way to parse without allocating an intermediate `Array`.

### Modifications
add `DER.lazySet(of:identifier:rootNode)` which returns its result without allocating.

### Result
We can eliminate allocations during parsing
2023-06-29 14:08:10 +01:00
Cory Benfield 748ece52a8 Avoid using stride(from:to:by:).reversed() (#31)
While this is a nice clear construction, it also has to allocate a temporary
Array, as the StrideTo type is not a BidirectionalCollection but a Sequence.
2023-05-24 09:32:27 +01:00
Cory Benfield 0700d170e8 Fix bug in comparing Generalized and UTC Time (#30)
The prior time comparison did not correctly handle wildly different
times. This patch resolves the issue.
0.9.1
2023-05-18 09:53:54 +01:00
Cory Benfield 1c5387a7ff Make GeneralizedTime and UTCTime Comparable. (#29)
In many cases it's useful to be able to place these into a total order.
This patch adds support for ordering them.
0.9.0
2023-05-18 07:31:59 +01:00
David Nadoba c43fef6dc0 Make PEMDocument Hashable (#28)
* Make `PEMDocument` `Hashable`

* Add `Sendable`
2023-04-21 10:36:29 +01:00
David Nadoba 67360b67fc Clean up the upToNextMinor (#27)
Minor cleanup in the `upToNextMinor` code in the README.
2023-04-19 17:58:29 +02:00
David Nadoba a53d9f676c Add PEM support through PEMRepresentable (#26)
* Add proper PEM support through `PEMRepresentable`

* Fix review comment and add more documentation

* Fix review comments

* Remove `allowedPEMDiscriminators`
0.8.0
2023-04-19 09:55:17 +01:00
Yim Lee 2e9c3326ab Add docker-compose file for Swift 5.9 (#25) 2023-04-12 17:52:47 -07:00
Joey b3aaa046fa Documentation - Typos (#24) 2023-04-11 00:39:26 -07:00
Dave Poirier 155b8acdb2 Changed scope of PEMDocument to public (#22) 2023-03-23 10:30:15 +00:00
Cory Benfield 0bb4cc3262 Merge pull request #20 from Lukasa/cb-minor-readme-fix
Clean up the upToNextMinor
2023-03-08 12:27:03 +00:00
Cory Benfield 0ddbd00164 Clean up the upToNextMinor 2023-03-08 12:23:04 +00:00