[openssl.org #3241] Patch: Constify openssl tables.

2014-08-26 Thread Rich Salz via RT
Declare victory and move on. New RT's for new const'ificiation as required.
Closing this ticket.
--
Rich Salz, OpenSSL dev team; rs...@openssl.org

__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


[openssl.org #3241] Patch: Constify openssl tables.

2014-06-29 Thread Stephen Henson via RT
While this patch is useful it causes non-trivial warnings. No update from
requestor. Marking as stalled for now.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org

__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


[openssl.org #3241] Patch: Constify openssl tables.

2014-06-29 Thread Ben Laurie via RT
As you know, constification is my vice.

The stuff that works easily has been committed to master at 8892ce7.

Other branches/attribution not dealt with.

__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


[openssl.org #3241] Patch: Constify openssl tables.

2014-01-28 Thread Stephen Henson via RT
On Mon Jan 20 20:45:43 2014, sl.ostape...@samsung.com wrote:
 Moves more than 10k from .data to .rodata .
 Reduces RAM usage when openssl is used in multiple process instances:
 http://code.google.com/p/chromium/issues/detail?id=249746
 Also might help compiler optimizer.


Thank you for the contribution. However this patch introduces a couple of
warnings about discarded const in crypto/srp/* which aren't trivial fixes.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org

__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org


[openssl.org #3241] Patch: Constify openssl tables.

2014-01-20 Thread Viatcheslav Ostapenko via RT
Moves more than 10k from .data to .rodata .
Reduces RAM usage when openssl is used in multiple process instances:
http://code.google.com/p/chromium/issues/detail?id=249746
Also might help compiler optimizer.


commit b3c85c9c1607a7ddb9f50d99900eafd3bf3c442c
Author: Viatcheslav Ostapenko sl.ostape...@samsung.com
Date:   Tue Jan 14 11:40:20 2014 -0500

Constify tables in openssl

Moves more than 10k from .data to .rodata .
Reduces RAM usage when openssl is used in multiple process
instances: http://code.google.com/p/chromium/issues/detail?id=249746
Also might help compiler optimizer.

diff --git a/crypto/bn/bn_add.c b/crypto/bn/bn_add.c
index f8e6729..257c2ea 100644
--- a/crypto/bn/bn_add.c
+++ b/crypto/bn/bn_add.c
@@ -107,7 +107,8 @@ int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
 int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
 	{
 	int max,min,dif;
-	BN_ULONG *ap,*bp,*rp,carry,t1,t2;
+	const BN_ULONG *ap,*bp;
+	BN_ULONG *rp,carry,t1,t2;
 	const BIGNUM *tmp;
 
 	bn_check_top(a);
@@ -168,7 +169,8 @@ int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
 int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
 	{
 	int max,min,dif;
-	register BN_ULONG t1,t2,*ap,*bp,*rp;
+	register BN_ULONG t1,t2,*rp;
+	register const BN_ULONG *ap,*bp;
 	int i,carry;
 #if defined(IRIX_CC_BUG)  !defined(LINT)
 	int dummy;
diff --git a/crypto/srp/srp.h b/crypto/srp/srp.h
index 7ec7825..c4017b3 100644
--- a/crypto/srp/srp.h
+++ b/crypto/srp/srp.h
@@ -120,7 +120,7 @@ int SRP_VBASE_init(SRP_VBASE *vb, char * verifier_file);
 SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username);
 char *SRP_create_verifier(const char *user, const char *pass, char **salt,
 			  char **verifier, const char *N, const char *g);
-int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, BIGNUM **verifier, BIGNUM *N, BIGNUM *g);
+int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, BIGNUM **verifier, const BIGNUM *N, const BIGNUM *g);
 
 
 #define SRP_NO_ERROR 0
diff --git a/crypto/srp/srp_grps.h b/crypto/srp/srp_grps.h
index 8e3c35e..f4c13c8 100644
--- a/crypto/srp/srp_grps.h
+++ b/crypto/srp/srp_grps.h
@@ -1,6 +1,6 @@
 /* start of generated data */
 
-static BN_ULONG bn_group_1024_value[] = {
+static const BN_ULONG bn_group_1024_value[] = {
 	bn_pack4(0x9FC6,0x1D2F,0xC0EB,0x06E3),
 	bn_pack4(0xFD51,0x38FE,0x8376,0x435B),
 	bn_pack4(0x2FD4,0xCBF4,0x976E,0xAA9A),
@@ -18,15 +18,15 @@ static BN_ULONG bn_group_1024_value[] = {
 	bn_pack4(0x9C33,0xF80A,0xFA8F,0xC5E8),
 	bn_pack4(0xEEAF,0x0AB9,0xADB3,0x8DD6)
 };
-static BIGNUM bn_group_1024 = {
-	bn_group_1024_value,
+static const BIGNUM bn_group_1024 = {
+	(BN_ULONG*)bn_group_1024_value,
 	(sizeof bn_group_1024_value)/sizeof(BN_ULONG),
 	(sizeof bn_group_1024_value)/sizeof(BN_ULONG),
 	0,
 	BN_FLG_STATIC_DATA
 };
 
-static BN_ULONG bn_group_1536_value[] = {
+static const BN_ULONG bn_group_1536_value[] = {
 	bn_pack4(0xCF76,0xE3FE,0xD135,0xF9BB),
 	bn_pack4(0x1518,0x0F93,0x499A,0x234D),
 	bn_pack4(0x8CE7,0xA28C,0x2442,0xC6F3),
@@ -52,15 +52,15 @@ static BN_ULONG bn_group_1536_value[] = {
 	bn_pack4(0xB1F1,0x2A86,0x17A4,0x7BBB),
 	bn_pack4(0x9DEF,0x3CAF,0xB939,0x277A)
 };
-static BIGNUM bn_group_1536 = {
-	bn_group_1536_value,
+static const BIGNUM bn_group_1536 = {
+	(BN_ULONG*)bn_group_1536_value,
 	(sizeof bn_group_1536_value)/sizeof(BN_ULONG),
 	(sizeof bn_group_1536_value)/sizeof(BN_ULONG),
 	0,
 	BN_FLG_STATIC_DATA
 };
 
-static BN_ULONG bn_group_2048_value[] = {
+static const BN_ULONG bn_group_2048_value[] = {
 	bn_pack4(0x0FA7,0x111F,0x9E4A,0xFF73),
 	bn_pack4(0x9B65,0xE372,0xFCD6,0x8EF2),
 	bn_pack4(0x35DE,0x236D,0x525F,0x5475),
@@ -94,15 +94,15 @@ static BN_ULONG bn_group_2048_value[] = {
 	bn_pack4(0xF166,0xDE5E,0x1389,0x582F),
 	bn_pack4(0xAC6B,0xDB41,0x324A,0x9A9B)
 };
-static BIGNUM bn_group_2048 = {
-	bn_group_2048_value,
+static const BIGNUM bn_group_2048 = {
+	(BN_ULONG*)bn_group_2048_value,
 	(sizeof bn_group_2048_value)/sizeof(BN_ULONG),
 	(sizeof bn_group_2048_value)/sizeof(BN_ULONG),
 	0,
 	BN_FLG_STATIC_DATA
 };
 
-static BN_ULONG bn_group_3072_value[] = {
+static const BN_ULONG bn_group_3072_value[] = {
 	bn_pack4(0x,0x,0x,0x),
 	bn_pack4(0x4B82,0xD120,0xA93A,0xD2CA),
 	bn_pack4(0x43DB,0x5BFC,0xE0FD,0x108E),
@@ -152,15 +152,15 @@ static BN_ULONG bn_group_3072_value[] = {
 	bn_pack4(0xC90F,0xDAA2,0x2168,0xC234),
 	bn_pack4(0x,0x,0x,0x)
 };
-static BIGNUM bn_group_3072 = {
-	bn_group_3072_value,
+static const BIGNUM bn_group_3072 = {
+	(BN_ULONG*)bn_group_3072_value,
 	(sizeof bn_group_3072_value)/sizeof(BN_ULONG),
 	(sizeof bn_group_3072_value)/sizeof(BN_ULONG),
 	0,
 	BN_FLG_STATIC_DATA
 };
 
-static BN_ULONG bn_group_4096_value[] = {
+static const BN_ULONG bn_group_4096_value[] = {
 	bn_pack4(0x,0x,0x,0x),
 	bn_pack4(0x4DF4,0x35C9,0x3406,0x3199),
 	bn_pack4(0x86FF,0xB7DC,0x90A6,0xC08F),
@@ -226,15 +226,15 @@ static BN_ULONG