Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Kanamori <atsushik@microsoft.com>2016-09-29 22:00:43 +0300
committerAtsushi Kanamori <atsushik@microsoft.com>2016-09-29 22:00:43 +0300
commitadda8075ed4fd3bd70d8c1ba852e8cf67c83000f (patch)
treeeb8fa75b5b99b86fbd400a06461210a567549a2e /src/Native/Runtime/sha1.cpp
parent1e39416f91337cc96e4613133de6e9c72e63dd7b (diff)
Convert SHA1 to RuntimeImport (Step 1)
After feedback from Jan, we've already opened-sourced a vetted C++ SHA1 algorithm in CoreClr, so rather than impose a dependency on crypto at the lowest level, we'll port that code into mrt100_app.dll. Unfortunately, the actual act of *adding* a simple .cpp file to MRT, let alone a new export, is harder than actually implementing it, and requires touching TFS-only files. So we'll add the import as a NYI stub as the first step, then finish the work once it propagates to the CoreRt master branch (that seems to be the most efficient work environment for this kind of job.) The new import converts a PK to a PKT by computing the SHA1 and reverse-copying the last 8 bytes. Doing the reverse-copy-8 in C++ prevents the non-FIPS-compliant SHA1 algorithm from turning into an attractive nuisance by being exported directly from MRT. SHA1.cpp and SHA1.h are verbatim copies of CoreClr's versions, which we're committing now to establish a diff history. Since adding a .cpp file is such a chore, we'll include it in the build with the #if 0's" in the magic places to keep the build system and file tracker off the scent. The "pbPublicKeyToken" can only be 8 bytes, so strictly speaking, passing a length argument isn't necessary but passing an unguarded buffer to C++ gets everyone looking at you like you have fleas so we'll add the extra defense-in-depth parameter. [tfs-changeset: 1630122]
Diffstat (limited to 'src/Native/Runtime/sha1.cpp')
-rw-r--r--src/Native/Runtime/sha1.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Native/Runtime/sha1.cpp b/src/Native/Runtime/sha1.cpp
index 96517b559..650d7939f 100644
--- a/src/Native/Runtime/sha1.cpp
+++ b/src/Native/Runtime/sha1.cpp
@@ -40,9 +40,12 @@ Revision History:
*/
+
#include "common.h"
-#include "sha1.h"
-#include "contract.h"
+//#include "sha1.h"
+//#include "contract.h"
+
+#if 0
typedef const DWORD DWORDC;
#define ROTATE32L(x,n) _rotl(x,n)
@@ -410,3 +413,5 @@ BYTE *SHA1Hash::GetHash()
return m_Value;
}
+#endif
+