Commit Graph
14 Commits
Author SHA1 Message Date
Viktor Hofer b54561a957 Fix VS complaining about missing projects in slns (continued) (#68543)
* Infra clean-up to simplify auto references

* Ref project file updates

* Src project file updates

* Test project file updates
2022-04-27 17:27:56 +02:00
Eric Erhardt 18be907176 Change Nullable to default to enable in libraries src and ref projects (#68102)
* Change the default Nullable to enabled for src projects

* Set Nullable=enable as the default for ref projects

* Fixup merge conflicts

* Disable nullable on shim projects and EventLog.Messages

* Set Nullable to blank on EventLog.Messages

This way no CodeAnalysis attributes are emitted into the assembly.
2022-04-25 11:15:37 -05:00
Stephen Toub 215b39abf9 Remove usage of !! from dotnet/runtime (#68178)
* Remove usage of !! from dotnet/runtime

- Use ArgumentNullException.ThrowIfNull instead where possible.  It's only usable for projects that only target .NET 6+, and it can't be used in places like this(...) or base(...).
- In other cases, if the project already has a ThrowHelper, augment it for null as needed and use that.
- For most of the extensions projects, add a ThrowHelper.ThrowIfNull that replicates ArgumentNullException.ThrowIfNull.
- For everything else, just use "throw new".

* Address PR feedback

* Address PR feedback

* Remove false positives from searches

* Address PR feedback
2022-04-21 13:25:52 -04:00
David Cantú a29a33456b S.S.C.Cose: Add Async Stream-based signatures (#67786)
* Add SignAsync(stream) and VerifyAsync(Stream)

* Address src feedback

* * Add sync Stream APIs and tests
* Address feedback

* * Add newlines to long signatures
* Remove try-finally form ArrayPool rents on async context
2022-04-11 18:32:49 -07:00
David Cantú 5ec483c642 S.S.C.Cose: Remove ECDsa and RSA overloads in favor of AsymmetricAlgorithm (#67661)
* Remove ECDsa and RSA overloads in favor of AsymmetricAlgorithm

* GenAPI changes

* Assert parameter names

* Keep _dummy and _dummyPrimitive

https://github.com/dotnet/arcade/issues/8792#issuecomment-1090915957
2022-04-07 18:29:12 -07:00
David Cantú 321cec85d9 Use ROS<byte> instead of byte[] where it makes sense on S.S.C.Cose (#66741)
* Use ROS<byte> instead of byte[] on S.S.C.Cose

* Add TrySign and improve Sign implementation to use less byte[]

* Add TrySign tests

* Address using scope feedback

* Address src feedback

* Refactor tests to avoid duplicated ones

* Remove invalid asserts in Crypto code

* Fix 'new()' without the type on the left-hand side

* Fix ThreadStatic issues in tests

* * Don't use ArrayPool in SignCore
* Add comment describing reusability of encoded protected headers
* Cache toBeSigned

* Don't cache toBeSigned for detached content

* Address nits in tests
2022-03-31 23:00:28 -07:00
Marek Safar 6a889d2342 Enable CA1822 (Mark members as static) analyzer (#66333) 2022-03-25 12:06:33 +01:00
Eric Erhardt 7508080ebc Update coding-style to include target-typed new() guideline (#67061)
* Update coding-style to include target-typed new guideline

Similar to `var` usage, `new()` usage is only allowed when the Type can be understood from the same line.

Fix #53369

* Fix coding style violations
2022-03-23 18:54:51 -06:00
David Cantú a5f3f963d7 Address a few TODOs on S.S.C.Cose. (#66641)
* Make HeaderMaps optionals

* Improve handling of integers larger/smaller than int32 in Alg header
2022-03-15 23:48:29 -07:00
Elinor Fung a0635832f1 Rename DllImportGenerator project to LibraryImportGenerator (#66029) 2022-03-03 22:17:23 -08:00
Viktor Hofer febaf76743 Fix slngen.proj and update solution files (#65711)
* Fix slngen.proj

The SolutionName property is defined by the SDK and hence the condition was always true. Also the star (*) didn't expand when using the ValurOrDefault msbuild function. Fixing this by using a different name `SolutionNameOverride` and avoiding the ValueOrDefault msbuild function.

* Update solution files

Updating the solution files as those changed because of
microsoft/slngen@cb57e28 and apparently the solution files never were
updated.
2022-02-22 17:18:54 +01:00
WraithandVlad Brezae ddb22ef2ac Remove S.R.CS.Unsafe and Intrinsify Unsafe (#64861)
* private assemblies moved from Internal to System Runtime.CompilerServices

* reformat existing unsafe vm intrinsics

* implement Copy, CopyBlock, CopyBlockUnaligned, InitBlock, InitBlockUnaligned, Unbox, Add, Subtract, SubtractByteOffset

* remove System.Runtime.CompilerServices.Unsafe il project and replace with forward only cs project

* change all ilproj references to csproj

* remove nativeaot Unsafe

* add conditional package reference for S.R.CS.Unsafe on netcoreapp 6.0

* regenerate solutions

* mono interp

* [mono][interp] Implement Copy and Unbox intrinsics

* [mono][jit] Implement Copy and Unbox intrinsics

Co-authored-by: Vlad Brezae <[email protected]>
2022-02-19 21:50:14 -08:00
Stephen Toub 1ba0394d71 Second round of changing null checks to !! (#65108) 2022-02-10 20:40:07 -05:00
David Cantú cf3aeb1609 Add S.S.C.Cose with COSE Sign1 support (#64461)
* Add S.S.C.Cose

* Override Equals in CoseHeaderLabel

* Add SystemFormatsCborVersion to eng/Versions.props

* Address PR feedback

* Remove commented Debugger.Launch from test

* Src:
* Support signing with empty header maps
* Add HashAlgorithmName argument to the granular APIs
Tests:
* Make crypto keys ThreadStatic to avoid race conditions
* Exclude CoseMessage and CoseSign1Message from browser
* Define DefaultKey and DefaultHash to simplify tests
* Overall clean-up

* Use explicit type instead of var

* Tests: Add logic to verify expected headers

* Do not mutate the protectected map when alg header was not specified

* src: Address suggestions

* tests:
* Fix ThreadStatic properties
* Switch from SkipOnPlatformAttribute to IgnoreForCI in csproj

* src: Address style suggestions

* Use ProjectRef instead of PackageRef

* RequiresPreviewFeaturesAttribute must be internal in non-netcoreapp

* Address feedback on CoseHeaderLabel

* src: use RequiresPreviewFeatures as assembly level attribute
tests: add test project to exclusion list of local browser runs
2022-02-07 15:21:03 -08:00