- Get it to compile again; lots changed since it was removed.
- Fix the package; lots changed since it was removed.
- Fix the Unix implementation to be usable; previous hacky attempts were made to provide deeper security but that significantly impacted usability... now it simply keeps the data in unmanaged memory and ensures it's zeroed out when disposed.
- Added missing methods to SecureStringMarshal
- Improved the tests
- General additional code cleanup
Commit migrated from https://github.com/dotnet/corefx/commit/d144478997b46afcf7a82e6860fce3c29d0dcf62
`build.cmd /p:LockDependencies=true` was the start of this change, but some errors with xunit build numbers led to all xunit upgrades being reset back to what they had in master.
project.json changes:
* System.Net.Security\src Switch off of explicit beta versioning, use the same baseline as everyone else. The S.S.C.Algorithms explicit upgrade is no longer required.
* System.Net.Requests\tests didn't build. Looking at the project.lock.json change, it appeared that a System.Net.Http reference was lost, restored it.
* System.Net.Http\tests didn't build. Looking at the project.lock.json change, it appeared that a System.IO.FileSystem reference was lost, restored it.
* System.Net.WebSockets.Client\src didn't build. Looking at the project.lock.json change, it appeared that a System.Collections (4.0.10) reference was lost, restored it.
* System.Diagnostics.TextWriterTraceListener\tests needed the runtime reference to load the correct System.Diagnostics.TraceSource binary.
Commit migrated from https://github.com/dotnet/corefx/commit/cec3a0f2db542bfa9d9c56bf988d966eacc35ad9
The corefx build used an older beta5 version of DNX which hardcoded the path to bash in dnu, breaking the build on FreeBSD.
Updating DNX to the latest "stable" beta7 release fixes this.
After updating I noticed a few test projects didn't build anymore as they were missing some dependencies in project.json, added those.
Fixesdotnet/corefx#3173
Commit migrated from https://github.com/dotnet/corefx/commit/6df77fdbb6cf8e0d35a3074bb325f7810085daa3
Today in several places we get a user's home directory by accessing the HOME environment variable. This is the right place to check first, but in certain cases it may not be set, such as in initialization scripts.
This commit implements a fallback, such that if HOME doesn't have a path, we consult the pw_dir path from a call to getpwuid_r for the current user.
As long as I was adding getpwuid_r to the native shim, I also moved our existing geteuid and getegid imports to the shims.
Commit migrated from https://github.com/dotnet/corefx/commit/5b8f55c8d43a880147478cb7d2191fa607000594
This change updates the assembly versions of all of the corefx assemblies
as needed after we shipped stable versions. Assemblies with API differences
get a minor version bump. Assemblies with only bugfixes get a build version
bump.
In order to facilitate this I had to update the reference assemblies, so I took
the opportunity to port them all to the open.
[tfs-changeset: 1514419]
Commit migrated from https://github.com/dotnet/corefx/commit/40723b795917f2e98b64d45c17effb2546dd0cae
* Defer conversions until necessary
* Rename Errno -> RawErrno
* Return null for ERANGE for strerror
* Add conversion helper for Error -> ErrorInfo
* Fix typos
* Remove unnecessary _POSIX_C_SOURCE define
* Fix names and sizes of managed FileStatus members
* Don't double-initialize ErrorInfo out param
* Zero out BirthTime when not available
* Put back newline at EOL
* Restore size of UnixFileSystemObject
* Use ignored local name for ignored error info
* Rename Interop.System to Interop.Sys to avoid
collision with System namespace
Commit migrated from https://github.com/dotnet/corefx/commit/e82401bd3feea682832215d1e97dbb4bb73e211a
System.Security.Cryptography.Primitives uses System.IO-4.0.10. The rest of the cryptography libraries seems to get an implicit reference to System.IO, but 4.0.0. A post-build analysis is not pleased by this state of affairs.
So, for all libraries that currently package-to-package reference System.Security.Cryptography.Primitives; add a System.IO-4.0.10 reference.
Commit migrated from https://github.com/dotnet/corefx/commit/115a4a3101e60773f1b5fed77b5f2cb4f2a164bd
This change modifies the build to consume the stable version where available.
This disables building the dowlevel packages since we shipped them once as stable and we're done.
From here on out, we'll only build the latest version (except for a servicing event, which would
be handled by syncing to a hash).
I can't rev the package versions in the normal way yet (by modifying the assembly version of the contents)
because that turned out to be too big of a problem to tackle in this change. Instead I added a
parameter to the task that calculates package versions to do the rev for anything that was
stable, but only when building the package itself, not when calculating the dependencies.
This has the downside of not permitting a dependency on a incremented pre-release version if we've
shipped a stable version, but that is a small point in time problem until I can rev the assembly
versions.
[tfs-changeset: 1508664]
Commit migrated from https://github.com/dotnet/corefx/commit/ee1ec2891c7c65b46fa9dfb078636be503bb2a60
Some of the contracts were moved in their entirety:
System.Security.Cryptography.Encryption => System.Security.Cryptography.Primitives
System.Security.Cryptography.Hashing => System.Security.Cryptography.Primitives
System.Security.Cryptography.RandomNumberGenerator => System.Security.Cryptography.Algorithms
System.Security.Cryptography.Encryption.Aes => System.Security.Cryptography.Algorithms
System.Security.Cryptography.Hashing.Algorithms => System.Security.Cryptography.Algorithms
System.Security.Cryptography.DeriveBytes => System.Security.Cryptography.Algorithms
The only partitioned library was System.Security.Cryptography.RSA:
The RSA base class and supporting types => System.Security.Cryptography.Algorithms
The RSACryptoServiceProvider class and additional supporting types => System.Security.Cryptography.Csp
The internal RSAOpenSsl type was made public => System.Security.Cryptography.OpenSsl
RSACng was copied from desktop => System.Security.Cryptography.Cng
This change also pulls in the RSA contract refresh from 4.6.
It does not yet add RSA.Create() to do the right reflection-forward lookups (the change was already big enough)
It also has the sad side effect of turning off the RSA tests for Linux, but fixing that problem is high on my list after getting the packages published. (I wanted to keep as many files as possible intact so they show as moves both in TFS and on github... rename+edit in TFS will likely not show up as cleanly in git).
Git builds will continue to have test coverage, but with the old contracts disabled ToF tests will shut down. ToF tests will be re-enabled in a followup change.
[tfs-changeset: 1505642]
Commit migrated from https://github.com/dotnet/corefx/commit/ce0506baea623efdb74707aee0e4aa169d6f468c
This change adds the lock files to repo to ensure we build against a stable set of dependencies. To explicitly update dependencies use build.cmd /T:RestorePackages /P:LockDependencies=true and this will pick up the latest depenedencies.
Existing projects adding new dependencies will automatically update the lock file incrementally.
New projects should make sure to check their lock file in with locked set to true.
[tfs-changeset: 1474296]
Commit migrated from https://github.com/dotnet/corefx/commit/d2fbc005707933db1cebca035d6cd6073af6cae4
Each time a modification is made to a SecureString, the buffer is decrypted, modified, and encrypted. And each of these operations results in a new buffer being created. But the old buffer isn't being disposed, meaning it's left for finalization.
This commit calls Dispose on such buffers.
Commit migrated from https://github.com/dotnet/corefx/commit/98e72ffe453ada38b3f0f0c471526bb28bad4f1b
Latest packages are now on dotnet-core myget feed.
This should address a many of the warnings in the build. I will follow up with another change to address the rest.
This change brings in the latest build tools with updates to consume "latest" packages (* versions).
I've updated every project in the repo to use * versioning for dependencies.
The new packages can be used to resolve runtime assets as well (like clrcompression.dll) so I have removed the custom code in System.IO.Compression to copy this dll. Instead the test project references the actual System.IO.Compression package and sets the correct runtime IDs to pull out the resources. The System.IO.Compression.dll from the package is not used since the project reference takes precedence.
I had to workaround an issue in System.Xml.XmlSerializer with the current packages: System.Runtime.WindowsRuntime 4.0.0 has a depedendency on "windows" package which doesn't exist. This was caused by our auto-generation task not filtering the winrt reference in the reference assembly's surface area. I've fixed this in a separate change and we can remove the workaround once we have a new set of packages. https://github.com/dotnet/corefx/issues/1761
I also had to add a dependency to System.Security.Cryptography.Hashing.Algorithms\tests due to an issue with DNX. It's not honoring the dependency group with no targetFramework when another dependency group exists in the nuspec. This is inconsistent with nuget v2 and should be fixed in DNX. https://github.com/aspnet/dnx/issues/1881
[tfs-changeset: 1471885]
Commit migrated from https://github.com/dotnet/corefx/commit/08c0d8628ef621fbd44d7aaa85b3239616a6b108
When characters are removed from a SecureString, the decrypted length can be less than the size of the currently allocated buffer. When characters are then added again, a new buffer is allocated of size decrypted length + 1, which still might be smaller than the current buffer size. The code attempts to copy everything from the current buffer to the new buffer, and fails due to the mismatch in lengths.
This commit modifies the SafeBSTRHandle.Copy routine to accept the number of bytes to copy, such that the call sites can specify exactly how much they want copied rather than the function gleaming it from the length of the source.
Commit migrated from https://github.com/dotnet/corefx/commit/d9ec05cf3b30cb3927684a8389aa7f5678acf464
Some of the calls to SafeBSTRHandle.Allocate check for IsInvalid and then through OutOfMemoryException if it's invalid (as SysAllocStringLength returns a NULL ptr if there's insufficient memory). Other calls to it don't check, which will result in ObjectDisposedExceptions when the invalid SafeBuffer is used. This commit moves the checking for IsInvalid / the throwing of OutOfMemoryException into the Allocate method(s), such that the call sites don't need to worry about it.
There were also several call sites to Marshal.CoTaskMemAlloc that were checking for IntPtr.Zero and throwing an OutOfMemoryException, but such a check is duplicative of the exact same check and throw done in CoTaskMemAlloc itself. This commit removes those unnecessary checks/throws from the calls sites.
Commit migrated from https://github.com/dotnet/corefx/commit/c3fe84347e9f7b9465712a1aa0161ac1d4a21c31
DNX and BuildTools now support all of the nuget v2 conventions that we depend on so we can
move all remaining nuget v2 packages to the project.json file and eliminate packages.config.
This change also adds "frameworks" to the project.json so that dnu restore can calculate
applicable assets. I am not yet using "runtimes" in the project.json since we are still resolving
our runtime assets manually (eg: build tools copies known files from packages). A future
change will move us to using our runtime packages and add runtimes sections to projects
as appropriate.
Commit migrated from https://github.com/dotnet/corefx/commit/eb35a304c7e89e8b4335ed13c5d23706360d49a4