`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
Most of our testing until now has been on Linux. This PR represents a pass through the tests on OSX and provides fixes to get the System.IO.FileSystem, System.IO.Pipes, and System.IO.MemoryMappedFiles tests passing at 100%. Most of these fixes are product fixes, with just a few test fixes.
Primary src fixes:
- Lots of named values (errors, open flags, sysconf names, etc.) have different values across Linux and OSX: I've fixed those to be specific to the platform being compiled for. (In the future, we should consider introducing a native shim layer through which we make _all_ calls to Unix and have it surface a consistent view, so that we don't have to worry about this kind of issue.)
- Some functions or options to functions being used on Linux don't exist on OSX, e.g. madvise's DONTFORK, posix_fadvise, etc.; these have either been removed if not truly needed or moved behind the PAL layer to only be used on Linux.
- Some functions (e.g. shm_open) have different behavior from Linux. For example, shm_open doesn't appear to work well with shared memory objects, such as not allowing MAP_PRIVATE and not supporting PROT_EXEC (though the OSX man pages don't mention this). In such cases, I've implemented a fallback, e.g. on OSX we use a temporary file rather than a shared memory object.
- Some functions have subtle differences around edge cases, e.g. mmap on Linux appears to allow the creation of a map with length that goes beyond that of the underlying medium, but then fails when trying to use it, whereas OSX moves the failure to the mmap call itself. I've implemented workarounds to smooth over these differences.
- Various error conditions were resulting in the wrong exception type based on different exception codes being returned on OSX than on Linux, e.g. additional error codes needed to be mapped to IOException when rmdir fails.
- Replaced direct usage of getenv through P/Invoke with calls to Environment.GetEnvironmentVariable. (These are a holdover from when we didn't yet have GetEnvironmentVariable available.)
- Fixed up a few places we could be using CheckIo but instead had effectively written out its implementation manually.
Primary test fixes:
- Some of the file system tests are just plain buggy, regardless of platform, with timing issues that are more likely to show up on a debug runtime. I've fixed the ones that manifested while I was doing this testing, but the file system tests really deserved to be overhauled in general.
- Windows' implementation of File/DirectoryInfo returns default values for CreationTime when created for a file that doesn't exist; this appears to be purely for back compat with previously buggy behavior, so I changed the test to only verify this on Windows, rather than implement similar buggy behavior on Linux/OSX.
- A few test cases that were previously exempted for Linux also needed to be exempted for OSX.
- Re-enabled the System.Dynamic.Runtime.Tests now that the associated runtime error that was causing them to fail has been fixed.
Commit migrated from https://github.com/dotnet/corefx/commit/5a912670b442f7f7984b6d7f0be190213f726fd4
This change updates all projects to the latest CoreFx packages which make use of nuget v3 features and thus require project.json. Packages.config remains for the packages which are not yet compatible with the new build task (mainly because we need to resolve to PCL folders).
The entire change was done by a tool in order to not miss any dependencies, and ensure we have project items for the packages.config/project.json. One side effect of using the tool is some reformatting of whitespace in the projects.
Commit migrated from https://github.com/dotnet/corefx/commit/e729c5353070b71aedff8f1300ae838573813faf
This commit provides a basic implementation of SecureString that will run on Unix and that will provide the expected inputs/outputs for consumers, but that doesn't do any encryption. If/when we figure out the right way to do that, we can add it later. For now, the implementation still stores the data in a native heap (so that the GC doesn't move it around leaving copies behind), zeroes out the data when done with it, uses mlock to attempt to keep the pages from getting swapped out, and uses mprotect to cause seg faults when attempting to access the data while at rest.
Commit migrated from https://github.com/dotnet/corefx/commit/2ba8de9b215b835463a8c402996e54044be6f650
Initial commit for System.Security.SecureString src and tests.
SecureString provides a mechanism to represent a text that should be kept confidential.
The text is encrypted for privacy when used, and is deleted from the computer memory
when no longer needed.
Commit migrated from https://github.com/dotnet/corefx/commit/aaaa4da5a51eaacdfd8897c490f3f843149010e5