summaryrefslogtreecommitdiffstats
path: root/fips
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2011-10-20 12:09:13 +0000
committerAndy Polyakov <appro@openssl.org>2011-10-20 12:09:13 +0000
commit5f132a0356460267c10333626be24f4d8a7df3f0 (patch)
tree019eaacea6f5b85b74250f53cbdc78a41979d689 /fips
parentd528caa7254eef18f862c4d6c2f624a9f6703c17 (diff)
fips/fips_[canister|premain].c: make it work with VC6 and add sentinels
even to code segments.
Diffstat (limited to 'fips')
-rw-r--r--fips/fips_canister.c20
-rw-r--r--fips/fips_premain.c3
-rw-r--r--fips/fips_premain.c.sha12
-rw-r--r--fips/fipssyms.h3
4 files changed, 22 insertions, 6 deletions
diff --git a/fips/fips_canister.c b/fips/fips_canister.c
index 4f187948a2..9e1b038197 100644
--- a/fips/fips_canister.c
+++ b/fips/fips_canister.c
@@ -60,7 +60,13 @@ static void *instruction_pointer_xlc(void);
* big-endian encoded variable names, just to prevent these arrays
* from being merged by linker. */
# if defined(_MSC_VER)
-# pragma section("fipsro$a",read)
+# pragma code_seg("fipstx")
+# pragma code_seg()
+ __declspec(allocate("fipstx"))
+const unsigned int FIPS_text_startX[]=
+ { 0x46495053, 0x5f746578, 0x745f7374, 0x61727458 };
+# pragma const_seg("fipsro$a")
+# pragma const_seg()
__declspec(allocate("fipsro$a"))
# endif
const unsigned int FIPS_rodata_start[]=
@@ -71,13 +77,20 @@ const unsigned int FIPS_rodata_start[]=
# define instruction_pointer FIPS_text_endX
# endif
# if defined(_MSC_VER)
-# pragma section("fipsro$c",read)
- __declspec(allocate("fipsro$c"))
+# pragma code_seg("fipstx$z")
+# pragma code_seg()
+ __declspec(allocate("fipstx$z"))
+const unsigned int FIPS_text_endX[]=
+ { 0x46495053, 0x5f746578, 0x745f656e, 0x64585b5d };
+# pragma const_seg("fipsro$z")
+# pragma const_seg()
+ __declspec(allocate("fipsro$z"))
# endif
const unsigned int FIPS_rodata_end[]=
{ 0x46495053, 0x5f726f64, 0x6174615f, 0x656e645b };
#endif
+#if !defined(_MSC_VER) || !defined(instruction_pointer)
/*
* I declare reference function as static in order to avoid certain
* pitfalls in -dynamic linker behaviour...
@@ -159,6 +172,7 @@ static void *instruction_pointer(void)
#endif
return ret;
}
+#endif
/*
* This function returns pointer to an instruction in the vicinity of
diff --git a/fips/fips_premain.c b/fips/fips_premain.c
index fc448d0eaa..a7c8b78f8f 100644
--- a/fips/fips_premain.c
+++ b/fips/fips_premain.c
@@ -69,7 +69,8 @@
#endif
#if defined(_MSC_VER)
-# pragma section("fipsro",read)
+# pragma const_seg("fipsro")
+# pragma const_seg()
__declspec(allocate("fipsro"))
#endif
static const unsigned char FINGERPRINT_ascii_value[41] = HMAC_SHA1_SIG;
diff --git a/fips/fips_premain.c.sha1 b/fips/fips_premain.c.sha1
index 20fa600a78..e0332e8afd 100644
--- a/fips/fips_premain.c.sha1
+++ b/fips/fips_premain.c.sha1
@@ -1 +1 @@
-HMAC-SHA1(fips_premain.c)= 3b8c0f293cb26288698881095a7be2e2fc24ea6b
+HMAC-SHA1(fips_premain.c)= a401afd9c2b57f0f11d2b34b6d0c9815b1fe6a66
diff --git a/fips/fipssyms.h b/fips/fipssyms.h
index 08c69da77a..5b1e188785 100644
--- a/fips/fipssyms.h
+++ b/fips/fipssyms.h
@@ -669,7 +669,8 @@
#define bn_gather5 fips_bn_gather5
#if defined(_MSC_VER)
-# pragma section("fipsro$b",read)
+# pragma const_seg("fipsro$b")
+# pragma const_seg()
# define __fips_constseg __declspec(allocate("fipsro$b"))
#else
# define __fips_constseg