Skip to content

Commit d24fe20

Browse files
committed
Import minimalistic BouncyCastle for ECDH
With some rewrites to avoid import of unneeded features.
1 parent bd01d97 commit d24fe20

File tree

81 files changed

+19213
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+19213
-6
lines changed

THIRD-PARTY-NOTICES.TXT

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
SSH.NET uses third-party libraries or other resources that may be
2+
distributed under licenses different than the SSH.NET software.
3+
4+
License notice for BouncyCastle
5+
-------------------------------
6+
7+
http://bouncycastle.org/csharp
8+
9+
Copyright (c) 2000 - 2018 The Legion of the Bouncy Castle Inc. (http://www.bouncycastle.org)
10+
11+
Permission is hereby granted, free of charge, to any person obtaining a copy of
12+
this software and associated documentation files (the "Software"), to deal in
13+
the Software without restriction, including without limitation the rights to
14+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
15+
the Software, and to permit persons to whom the Software is furnished to do so,
16+
subject to the following conditions:
17+
18+
The above copyright notice and this permission notice shall be included in all
19+
copies or substantial portions of the Software.
20+
21+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
23+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
24+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
25+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

src/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj

+217-1
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,222 @@
602602
<Compile Include="..\Renci.SshNet\Security\Algorithm.cs">
603603
<Link>Security\Algorithm.cs</Link>
604604
</Compile>
605+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\asn1\sec\SECNamedCurves.cs">
606+
<Link>Security\Cryptography\BouncyCastle\asn1\sec\SECNamedCurves.cs</Link>
607+
</Compile>
608+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\asn1\x9\X9Curve.cs">
609+
<Link>Security\Cryptography\BouncyCastle\asn1\x9\X9Curve.cs</Link>
610+
</Compile>
611+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\asn1\x9\X9ECParameters.cs">
612+
<Link>Security\Cryptography\BouncyCastle\asn1\x9\X9ECParameters.cs</Link>
613+
</Compile>
614+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\asn1\x9\X9ECParametersHolder.cs">
615+
<Link>Security\Cryptography\BouncyCastle\asn1\x9\X9ECParametersHolder.cs</Link>
616+
</Compile>
617+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\asn1\x9\X9ECPoint.cs">
618+
<Link>Security\Cryptography\BouncyCastle\asn1\x9\X9ECPoint.cs</Link>
619+
</Compile>
620+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\agreement\ECDHCBasicAgreement.cs">
621+
<Link>Security\Cryptography\BouncyCastle\crypto\agreement\ECDHCBasicAgreement.cs</Link>
622+
</Compile>
623+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\AsymmetricCipherKeyPair.cs">
624+
<Link>Security\Cryptography\BouncyCastle\crypto\AsymmetricCipherKeyPair.cs</Link>
625+
</Compile>
626+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\AsymmetricKeyParameter.cs">
627+
<Link>Security\Cryptography\BouncyCastle\crypto\AsymmetricKeyParameter.cs</Link>
628+
</Compile>
629+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\digests\GeneralDigest.cs">
630+
<Link>Security\Cryptography\BouncyCastle\crypto\digests\GeneralDigest.cs</Link>
631+
</Compile>
632+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\digests\Sha256Digest.cs">
633+
<Link>Security\Cryptography\BouncyCastle\crypto\digests\Sha256Digest.cs</Link>
634+
</Compile>
635+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\generators\ECKeyPairGenerator.cs">
636+
<Link>Security\Cryptography\BouncyCastle\crypto\generators\ECKeyPairGenerator.cs</Link>
637+
</Compile>
638+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\IAsymmetricCipherKeyPairGenerator.cs">
639+
<Link>Security\Cryptography\BouncyCastle\crypto\IAsymmetricCipherKeyPairGenerator.cs</Link>
640+
</Compile>
641+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\IDigest.cs">
642+
<Link>Security\Cryptography\BouncyCastle\crypto\IDigest.cs</Link>
643+
</Compile>
644+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\KeyGenerationParameters.cs">
645+
<Link>Security\Cryptography\BouncyCastle\crypto\KeyGenerationParameters.cs</Link>
646+
</Compile>
647+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\parameters\ECDomainParameters.cs">
648+
<Link>Security\Cryptography\BouncyCastle\crypto\parameters\ECDomainParameters.cs</Link>
649+
</Compile>
650+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\parameters\ECKeyGenerationParameters.cs">
651+
<Link>Security\Cryptography\BouncyCastle\crypto\parameters\ECKeyGenerationParameters.cs</Link>
652+
</Compile>
653+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\parameters\ECKeyParameters.cs">
654+
<Link>Security\Cryptography\BouncyCastle\crypto\parameters\ECKeyParameters.cs</Link>
655+
</Compile>
656+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\parameters\ECPrivateKeyParameters.cs">
657+
<Link>Security\Cryptography\BouncyCastle\crypto\parameters\ECPrivateKeyParameters.cs</Link>
658+
</Compile>
659+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\parameters\ECPublicKeyParameters.cs">
660+
<Link>Security\Cryptography\BouncyCastle\crypto\parameters\ECPublicKeyParameters.cs</Link>
661+
</Compile>
662+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\prng\CryptoApiRandomGenerator.cs">
663+
<Link>Security\Cryptography\BouncyCastle\crypto\prng\CryptoApiRandomGenerator.cs</Link>
664+
</Compile>
665+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\prng\DigestRandomGenerator.cs">
666+
<Link>Security\Cryptography\BouncyCastle\crypto\prng\DigestRandomGenerator.cs</Link>
667+
</Compile>
668+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\prng\IRandomGenerator.cs">
669+
<Link>Security\Cryptography\BouncyCastle\crypto\prng\IRandomGenerator.cs</Link>
670+
</Compile>
671+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\crypto\util\Pack.cs">
672+
<Link>Security\Cryptography\BouncyCastle\crypto\util\Pack.cs</Link>
673+
</Compile>
674+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\BigInteger.cs">
675+
<Link>Security\Cryptography\BouncyCastle\math\BigInteger.cs</Link>
676+
</Compile>
677+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\abc\SimpleBigDecimal.cs">
678+
<Link>Security\Cryptography\BouncyCastle\math\ec\abc\SimpleBigDecimal.cs</Link>
679+
</Compile>
680+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\abc\Tnaf.cs">
681+
<Link>Security\Cryptography\BouncyCastle\math\ec\abc\Tnaf.cs</Link>
682+
</Compile>
683+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\abc\ZTauElement.cs">
684+
<Link>Security\Cryptography\BouncyCastle\math\ec\abc\ZTauElement.cs</Link>
685+
</Compile>
686+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\ECAlgorithms.cs">
687+
<Link>Security\Cryptography\BouncyCastle\math\ec\ECAlgorithms.cs</Link>
688+
</Compile>
689+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\ECCurve.cs">
690+
<Link>Security\Cryptography\BouncyCastle\math\ec\ECCurve.cs</Link>
691+
</Compile>
692+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\ECFieldElement.cs">
693+
<Link>Security\Cryptography\BouncyCastle\math\ec\ECFieldElement.cs</Link>
694+
</Compile>
695+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\ECLookupTable.cs">
696+
<Link>Security\Cryptography\BouncyCastle\math\ec\ECLookupTable.cs</Link>
697+
</Compile>
698+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\ECPoint.cs">
699+
<Link>Security\Cryptography\BouncyCastle\math\ec\ECPoint.cs</Link>
700+
</Compile>
701+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\ECPointMap.cs">
702+
<Link>Security\Cryptography\BouncyCastle\math\ec\ECPointMap.cs</Link>
703+
</Compile>
704+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\endo\ECEndomorphism.cs">
705+
<Link>Security\Cryptography\BouncyCastle\math\ec\endo\ECEndomorphism.cs</Link>
706+
</Compile>
707+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\endo\GlvEndomorphism.cs">
708+
<Link>Security\Cryptography\BouncyCastle\math\ec\endo\GlvEndomorphism.cs</Link>
709+
</Compile>
710+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\LongArray.cs">
711+
<Link>Security\Cryptography\BouncyCastle\math\ec\LongArray.cs</Link>
712+
</Compile>
713+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\multiplier\AbstractECMultiplier.cs">
714+
<Link>Security\Cryptography\BouncyCastle\math\ec\multiplier\AbstractECMultiplier.cs</Link>
715+
</Compile>
716+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\multiplier\ECMultiplier.cs">
717+
<Link>Security\Cryptography\BouncyCastle\math\ec\multiplier\ECMultiplier.cs</Link>
718+
</Compile>
719+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\multiplier\FixedPointCombMultiplier.cs">
720+
<Link>Security\Cryptography\BouncyCastle\math\ec\multiplier\FixedPointCombMultiplier.cs</Link>
721+
</Compile>
722+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\multiplier\FixedPointPreCompInfo.cs">
723+
<Link>Security\Cryptography\BouncyCastle\math\ec\multiplier\FixedPointPreCompInfo.cs</Link>
724+
</Compile>
725+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\multiplier\FixedPointUtilities.cs">
726+
<Link>Security\Cryptography\BouncyCastle\math\ec\multiplier\FixedPointUtilities.cs</Link>
727+
</Compile>
728+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\multiplier\GlvMultiplier.cs">
729+
<Link>Security\Cryptography\BouncyCastle\math\ec\multiplier\GlvMultiplier.cs</Link>
730+
</Compile>
731+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\multiplier\IPreCompCallback.cs">
732+
<Link>Security\Cryptography\BouncyCastle\math\ec\multiplier\IPreCompCallback.cs</Link>
733+
</Compile>
734+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\multiplier\PreCompInfo.cs">
735+
<Link>Security\Cryptography\BouncyCastle\math\ec\multiplier\PreCompInfo.cs</Link>
736+
</Compile>
737+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\multiplier\ValidityPreCompInfo.cs">
738+
<Link>Security\Cryptography\BouncyCastle\math\ec\multiplier\ValidityPreCompInfo.cs</Link>
739+
</Compile>
740+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\multiplier\WNafL2RMultiplier.cs">
741+
<Link>Security\Cryptography\BouncyCastle\math\ec\multiplier\WNafL2RMultiplier.cs</Link>
742+
</Compile>
743+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\multiplier\WNafPreCompInfo.cs">
744+
<Link>Security\Cryptography\BouncyCastle\math\ec\multiplier\WNafPreCompInfo.cs</Link>
745+
</Compile>
746+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\multiplier\WNafUtilities.cs">
747+
<Link>Security\Cryptography\BouncyCastle\math\ec\multiplier\WNafUtilities.cs</Link>
748+
</Compile>
749+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\multiplier\WTauNafMultiplier.cs">
750+
<Link>Security\Cryptography\BouncyCastle\math\ec\multiplier\WTauNafMultiplier.cs</Link>
751+
</Compile>
752+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\ec\multiplier\WTauNafPreCompInfo.cs">
753+
<Link>Security\Cryptography\BouncyCastle\math\ec\multiplier\WTauNafPreCompInfo.cs</Link>
754+
</Compile>
755+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\field\FiniteFields.cs">
756+
<Link>Security\Cryptography\BouncyCastle\math\field\FiniteFields.cs</Link>
757+
</Compile>
758+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\field\GenericPolynomialExtensionField.cs">
759+
<Link>Security\Cryptography\BouncyCastle\math\field\GenericPolynomialExtensionField.cs</Link>
760+
</Compile>
761+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\field\GF2Polynomial.cs">
762+
<Link>Security\Cryptography\BouncyCastle\math\field\GF2Polynomial.cs</Link>
763+
</Compile>
764+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\field\IExtensionField.cs">
765+
<Link>Security\Cryptography\BouncyCastle\math\field\IExtensionField.cs</Link>
766+
</Compile>
767+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\field\IFiniteField.cs">
768+
<Link>Security\Cryptography\BouncyCastle\math\field\IFiniteField.cs</Link>
769+
</Compile>
770+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\field\IPolynomial.cs">
771+
<Link>Security\Cryptography\BouncyCastle\math\field\IPolynomial.cs</Link>
772+
</Compile>
773+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\field\IPolynomialExtensionField.cs">
774+
<Link>Security\Cryptography\BouncyCastle\math\field\IPolynomialExtensionField.cs</Link>
775+
</Compile>
776+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\field\PrimeField.cs">
777+
<Link>Security\Cryptography\BouncyCastle\math\field\PrimeField.cs</Link>
778+
</Compile>
779+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\raw\Mod.cs">
780+
<Link>Security\Cryptography\BouncyCastle\math\raw\Mod.cs</Link>
781+
</Compile>
782+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\math\raw\Nat.cs">
783+
<Link>Security\Cryptography\BouncyCastle\math\raw\Nat.cs</Link>
784+
</Compile>
785+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\security\DigestUtilities.cs">
786+
<Link>Security\Cryptography\BouncyCastle\security\DigestUtilities.cs</Link>
787+
</Compile>
788+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\security\SecureRandom.cs">
789+
<Link>Security\Cryptography\BouncyCastle\security\SecureRandom.cs</Link>
790+
</Compile>
791+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\security\SecurityUtilityException.cs">
792+
<Link>Security\Cryptography\BouncyCastle\security\SecurityUtilityException.cs</Link>
793+
</Compile>
794+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\util\Arrays.cs">
795+
<Link>Security\Cryptography\BouncyCastle\util\Arrays.cs</Link>
796+
</Compile>
797+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\util\BigIntegers.cs">
798+
<Link>Security\Cryptography\BouncyCastle\util\BigIntegers.cs</Link>
799+
</Compile>
800+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\util\encoders\Hex.cs">
801+
<Link>Security\Cryptography\BouncyCastle\util\encoders\Hex.cs</Link>
802+
</Compile>
803+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\util\encoders\HexEncoder.cs">
804+
<Link>Security\Cryptography\BouncyCastle\util\encoders\HexEncoder.cs</Link>
805+
</Compile>
806+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\util\Enums.cs">
807+
<Link>Security\Cryptography\BouncyCastle\util\Enums.cs</Link>
808+
</Compile>
809+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\util\IMemoable.cs">
810+
<Link>Security\Cryptography\BouncyCastle\util\IMemoable.cs</Link>
811+
</Compile>
812+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\util\Integers.cs">
813+
<Link>Security\Cryptography\BouncyCastle\util\Integers.cs</Link>
814+
</Compile>
815+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\util\MemoableResetException.cs">
816+
<Link>Security\Cryptography\BouncyCastle\util\MemoableResetException.cs</Link>
817+
</Compile>
818+
<Compile Include="..\Renci.SshNet\Security\BouncyCastle\util\Times.cs">
819+
<Link>Security\Cryptography\BouncyCastle\util\Times.cs</Link>
820+
</Compile>
605821
<Compile Include="..\Renci.SshNet\Security\CertificateHostAlgorithm.cs">
606822
<Link>Security\CertificateHostAlgorithm.cs</Link>
607823
</Compile>
@@ -981,4 +1197,4 @@
9811197
<Target Name="AfterBuild">
9821198
</Target>
9831199
-->
984-
</Project>
1200+
</Project>

src/Renci.SshNet.NETCore/Renci.SshNet.NETCore.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
3535
<DefineConstants>FEATURE_ENCODING_ASCII;FEATURE_DIAGNOSTICS_TRACESOURCE;FEATURE_DIRECTORYINFO_ENUMERATEFILES;FEATURE_MEMORYSTREAM_GETBUFFER;FEATURE_MEMORYSTREAM_TRYGETBUFFER;FEATURE_RNG_CREATE;FEATURE_SOCKET_TAP;FEATURE_SOCKET_APM;FEATURE_SOCKET_EAP;FEATURE_SOCKET_SYNC;FEATURE_SOCKET_SETSOCKETOPTION;FEATURE_SOCKET_SELECT;FEATURE_SOCKET_POLL;FEATURE_SOCKET_DISPOSE;FEATURE_DNS_SYNC;FEATURE_DNS_APM;FEATURE_DNS_TAP;FEATURE_STREAM_APM;FEATURE_STREAM_TAP;FEATURE_THREAD_COUNTDOWNEVENT;FEATURE_THREAD_TAP;FEATURE_THREAD_THREADPOOL;FEATURE_THREAD_SLEEP;FEATURE_WAITHANDLE_DISPOSE;FEATURE_HASH_MD5;FEATURE_HASH_SHA1_CREATE;FEATURE_HASH_SHA256_CREATE;FEATURE_HASH_SHA384_CREATE;FEATURE_HASH_SHA512_CREATE;FEATURE_HMAC_MD5;FEATURE_HMAC_SHA1;FEATURE_HMAC_SHA256;FEATURE_HMAC_SHA384;FEATURE_HMAC_SHA512</DefineConstants>
3636
</PropertyGroup>
37-
</Project>
37+
</Project>

0 commit comments

Comments
 (0)