• R/O
  • SSH
  • HTTPS

globalbase: Commit


Commit MetaInfo

Revisão5974 (tree)
Hora2019-08-17 13:02:54
Autorjoshua

Mensagem de Log

for deian 9

Mudança Sumário

Diff

--- modules/tinyState/trunk/src/arch/posix/std/stdOpenSSL.cpp (revision 5973)
+++ modules/tinyState/trunk/src/arch/posix/std/stdOpenSSL.cpp (revision 5974)
@@ -130,5 +130,7 @@
130130 void
131131 stdThreadOpenSSL::cleanup()
132132 {
133+#if OPENSSL_VERSION_NUMBER < 0x1010000
133134 ERR_remove_state(0);
135+#endif
134136 }
--- modules/tinyState/trunk/src/classes/ts/c++/sObject.cpp (revision 5973)
+++ modules/tinyState/trunk/src/classes/ts/c++/sObject.cpp (revision 5974)
@@ -154,7 +154,11 @@
154154
155155 void *
156156 sObject::operator new(size_t cbSize,const char * __file,int __line)
157- throw(std::bad_alloc)
157+#if __cplusplus >= 201103L
158+ noexcept(false)
159+#else
160+ throw(std::bad_alloc)
161+#endif
158162 {
159163 MEM_HEADER * mem = (MEM_HEADER*)malloc(cbSize+sizeof(MEM_HEADER));
160164 mem->size = cbSize;
@@ -170,7 +174,11 @@
170174
171175 void
172176 sObject::operator delete(void * pv)
177+#if __cplusplus >= 201103L
178+ noexcept(true)
179+#else
173180 throw()
181+#endif
174182 {
175183
176184 MEM_HEADER * mem;
@@ -223,7 +231,11 @@
223231
224232 void *
225233 operator new[](size_t cbSize,const char * __file,int __line)
234+#if __cplusplus >= 201103L
235+ noexcept(false)
236+#else
226237 throw(std::bad_alloc)
238+#endif
227239 {
228240 // ::printf("new[] %lu %s %i\n",cbSize,__file,__line);
229241 MEM_HEADER * mem = (MEM_HEADER*)malloc(cbSize+sizeof(MEM_HEADER));
@@ -239,7 +251,11 @@
239251
240252 void
241253 operator delete[](void * pv)
254+#if __cplusplus >= 201103L
255+ noexcept(true)
256+#else
242257 throw()
258+#endif
243259 {
244260 //printf("DELETE [] %p\n",pv);
245261 MEM_HEADER * mem = (MEM_HEADER*)pv;
--- modules/tinyState/trunk/src/classes/ts/c++/stdEVP.cpp (revision 5973)
+++ modules/tinyState/trunk/src/classes/ts/c++/stdEVP.cpp (revision 5974)
@@ -36,13 +36,17 @@
3636 unsigned char * pKey,
3737 unsigned char * pIV)
3838 {
39- EVP_CIPHER_CTX_init(&ctx);
39+#if OPENSSL_VERSION_NUMBER >= 0x1010000
40+ if ( ctxp == 0 )
41+ ctxp = EVP_CIPHER_CTX_new();
42+#endif
43+ EVP_CIPHER_CTX_init(ctxp);
4044 if ( direction == 'e' ) {
41- if ( EVP_EncryptInit_ex( &ctx, pCipher, NULL, pKey, pIV ) < 0 )
45+ if ( EVP_EncryptInit_ex( ctxp, pCipher, NULL, pKey, pIV ) < 0 )
4246 stdObject::panic("EVP initialize error");
4347 }
4448 else {
45- if ( EVP_DecryptInit_ex( &ctx, pCipher, NULL, pKey, pIV ) < 0 )
49+ if ( EVP_DecryptInit_ex( ctxp, pCipher, NULL, pKey, pIV ) < 0 )
4650 stdObject::panic("EVP initialize error");
4751 }
4852 this->direction = direction;
@@ -50,13 +54,15 @@
5054
5155 stdEVP::~stdEVP()
5256 {
53- EVP_CIPHER_CTX_cleanup(&ctx);
57+ EVP_CIPHER_CTX_cleanup(ctxp);
58+ EVP_CIPHER_CTX_free(ctxp);
59+ ctxp = 0;
5460 }
5561
5662 int
5763 stdEVP::size()
5864 {
59- return EVP_CIPHER_CTX_block_size(&ctx);
65+ return EVP_CIPHER_CTX_block_size(ctxp);
6066 }
6167
6268 int
@@ -89,7 +95,7 @@
8995 {
9096 if ( direction != 'e' )
9197 stdObject::panic("direction");
92- return EVP_EncryptUpdate(&ctx,out,outl,in,inl);
98+ return EVP_EncryptUpdate(ctxp,out,outl,in,inl);
9399 }
94100
95101 int
@@ -99,7 +105,7 @@
99105 {
100106 if ( direction != 'e' )
101107 stdObject::panic("direction");
102- return EVP_EncryptFinal_ex(&ctx,out,outl);
108+ return EVP_EncryptFinal_ex(ctxp,out,outl);
103109 }
104110
105111 int
@@ -111,7 +117,7 @@
111117 {
112118 if ( direction != 'd' )
113119 stdObject::panic("direction");
114- return EVP_DecryptUpdate(&ctx,out,outl,in,inl);
120+ return EVP_DecryptUpdate(ctxp,out,outl,in,inl);
115121 }
116122
117123 int
@@ -121,7 +127,7 @@
121127 {
122128 if ( direction != 'd' )
123129 stdObject::panic("direction");
124- return EVP_DecryptFinal_ex(&ctx,out,outl);
130+ return EVP_DecryptFinal_ex(ctxp,out,outl);
125131 }
126132
127133
--- modules/tinyState/trunk/src/h/ts/c++/sObject.h (revision 5973)
+++ modules/tinyState/trunk/src/h/ts/c++/sObject.h (revision 5974)
@@ -16,10 +16,17 @@
1616 class sObject {
1717 public:
1818 static void * operator new(size_t cbSize,const char * __file,int __line)
19+#if __cplusplus >= 201103L
20+ noexcept(false);
21+#else
1922 throw(std::bad_alloc);
23+#endif
2024 static void operator delete(void * pv)
25+#if __cplusplus >= 201103L
26+ noexcept(true);
27+#else
2128 throw();
22-
29+#endif
2330 static void panic(const char*);
2431
2532 static INTEGER64 total_mem_max;
@@ -62,9 +69,17 @@
6269 #define soFCLOSE(x) sObject::__fclose(x)
6370
6471 void * operator new[](size_t cbSize,const char * __file,int __line)
72+#if __cplusplus >= 201103L
73+ noexcept(false);
74+#else
6575 throw(std::bad_alloc);
76+#endif
6677 void operator delete[](void * pv)
78+#if __cplusplus >= 201103L
79+ noexcept(true);
80+#else
6781 throw();
82+#endif
6883
6984 #define NEW new (__FILE__,__LINE__)
7085 #define thNEW(__type,__arg) (stdObject::refLock(),sPtr<__type>(NEW __type __arg,1))
--- modules/tinyState/trunk/src/h/ts/c++/stdEVP.h (revision 5973)
+++ modules/tinyState/trunk/src/h/ts/c++/stdEVP.h (revision 5974)
@@ -44,7 +44,13 @@
4444 int size_encrypt(int ilen);
4545 int size_decrypt(int ilen);
4646 protected:
47+
48+#if OPENSSL_VERSION_NUMBER >= 0x1010000
49+ EVP_CIPHER_CTX * ctxp;
50+#else
4751 EVP_CIPHER_CTX ctx;
52+#define ctxp (&ctx)
53+#endif
4854 char direction;
4955
5056 void start(
Show on old repository browser