Commit Graph

1681 Commits

Author SHA1 Message Date
Manuel Pégourié-Gonnard
fe44643b0e Rename website and repository 2015-03-06 13:17:10 +00:00
Manuel Pégourié-Gonnard
1dd1674559 Move private macro from header to C file 2015-03-06 12:01:27 +00:00
Manuel Pégourié-Gonnard
385069f17d Add some missing 'static' on a few objects 2015-03-06 12:01:27 +00:00
Manuel Pégourié-Gonnard
02ba5785bf Fix -fPIC when cross-compiling to windows 2015-02-18 13:42:26 +00:00
Manuel Pégourié-Gonnard
f7db5e0a4a Avoid possible dangling pointers
If the allocation fails, we don't really want ssl->in_ctr = 8 lying around.
2015-02-18 10:32:41 +00:00
Manuel Pégourié-Gonnard
f45850c493 Fix the fix to ssl_set_psk()
- possible for the first malloc to fail and the second to succeed
- missing = NULL assignment
2015-02-18 10:23:52 +00:00
Manuel Pégourié-Gonnard
ac08b543db Merge remote-tracking branch 'rasp/mem-leak' into development
* rasp/mem-leak:
  Fix another potential memory leak found by find-mem-leak.cocci.
  Add a rule for another type of memory leak to find-mem-leak.cocci.
  Fix a potential memory leak found by find-mem-leak.cocci.
  Add a semantic patch to find potential memory leaks.
  Fix whitespace of 369e6c20.
  Apply the semantic patch rm-malloc-cast.cocci.
  Add a semantic patch to remove casts of malloc.

Conflicts:
	programs/ssl/ssl_server2.c
2015-02-18 10:07:22 +00:00
Mansour Moufid
f81088bb80 Fix a potential memory leak found by find-mem-leak.cocci. 2015-02-17 13:10:21 -05:00
Manuel Pégourié-Gonnard
981732bb8e Fix missing/misplaced #include's 2015-02-17 15:47:31 +00:00
Manuel Pégourié-Gonnard
491a3fe057 Fix compile error in memory_buffer_alloc_selftest 2015-02-16 17:28:11 +00:00
Manuel Pégourié-Gonnard
0da7b040d1 Rm usunused member in private struct 2015-02-16 17:28:10 +00:00
Manuel Pégourié-Gonnard
50da0482e0 Add heap usage for PK in benchmark 2015-02-16 17:28:10 +00:00
Manuel Pégourié-Gonnard
b8ca723154 Only define mode_func if mode is enabled (CBC etc) 2015-02-16 17:23:59 +00:00
Manuel Pégourié-Gonnard
a2424a045a PKCS8 encrypted key depend on PKCS5 or PKCS12 2015-02-16 17:22:47 +00:00
Manuel Pégourié-Gonnard
aff2976d10 Merge branch 'build' into development
* build:
  build: make: support windows cross compile
2015-02-16 15:26:09 +00:00
Manuel Pégourié-Gonnard
09eb14c01e Revert "Require unix-utils in path for windows make"
This reverts commit 5d46cca09a.

In preparation of merging an external contribution that superseedes this

Conflicts:
	ChangeLog
2015-02-16 15:25:31 +00:00
Manuel Pégourié-Gonnard
f812054d00 Revert "Replace SONAME with SOVERSION in makefile"
This reverts commit 418080010a.

In preparation of merging one external contribution that supersedes this.
2015-02-16 15:24:17 +00:00
Mansour Moufid
99b9259f76 Fix whitespace of 369e6c20. 2015-02-16 10:43:52 +00:00
Mansour Moufid
c531b4af3c Apply the semantic patch rm-malloc-cast.cocci.
for dir in library programs; do
        spatch --sp-file scripts/rm-malloc-cast.cocci --dir $dir \
        --in-place;
    done
2015-02-16 10:43:52 +00:00
Manuel Pégourié-Gonnard
d48bf6892c Write literal byte more clearly 2015-02-16 09:13:40 +00:00
Manuel Pégourié-Gonnard
85fadb749c Make loop bound more obvious
Helps static analyzers and does not decrease human readability.
2015-02-16 09:13:40 +00:00
Manuel Pégourié-Gonnard
6fdc4cae53 Fix potential signedness issue 2015-02-16 09:13:40 +00:00
Mansour Moufid
bd1d44e251 Fix whitespace of 369e6c20. 2015-02-15 17:51:07 -05:00
Mansour Moufid
369e6c20b3 Apply the semantic patch rm-malloc-cast.cocci.
for dir in library programs; do
        spatch --sp-file scripts/rm-malloc-cast.cocci --dir $dir \
        --in-place;
    done
2015-02-15 17:49:11 -05:00
Alon Bar-Lev
18ba0cce8b build: make: support windows cross compile
Add WINDOWS_BUILD macro to enable Windows build on *NIX host.

Add optional suffix for executables.

Fix shared object suffix logic to support multiple suffixes.

Fix soname handling to always match output.

WINDOWS macro sets WINDOWS_BUILD.

WINDOWS_BUILD sets .exe executable suffix.

WINDOWS_BUILD shared mode creates dll import library.

WINDOWS_BUILD shared mode link against dll.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
2015-02-14 01:20:17 +02:00
Manuel Pégourié-Gonnard
0928640095 Update generated files 2015-02-13 15:18:33 +00:00
Manuel Pégourié-Gonnard
ac1f76c362 Merge remote-tracking branch 'rich/platform' into development
* rich/platform:
  Remove dependency on sscanf in lib x509
  Fix extra guard in memory_buffer_alloc
  rebase from development
  implemented macro overriding for polarssl_* library functions
  fix bug introduced by the addition of snprintf and assert macro which caused tests to fail without polarssl_platform_c defined
  add initial symbols to config and checks to check_config to allow use of macros to define standard functions
  reformat and arrange additions to config alphabetically
  add missing checks to check_config
  add macro definition of assert using polarssl_exit
  modify library/memory_buffer_alloc.c, benchmark.c and the tests main code to use polarssl_exit
  add POLARSSL_PLATFORM_EXIT_ALT
  modify scripts/* and tests/* to use polarssl_snprintf
  modify programs/*.c to use polarssl_snprintf
  modify library/debug.c to use polarssl_snprintf
  modify library/x509*.c to use polarssl_snprintf
  modify library/net.c to use polarssl_snprintf
  modify oid.c to use polarssl_snprintf
  add platform_set_snprintf

Conflicts:
	library/memory_buffer_alloc.c
	programs/pkey/pk_sign.c
	programs/pkey/pk_verify.c
	programs/pkey/rsa_sign_pss.c
	programs/pkey/rsa_verify_pss.c
	programs/ssl/ssl_client2.c
	programs/ssl/ssl_pthread_server.c
	programs/test/benchmark.c
	programs/test/ssl_cert_test.c
2015-02-13 15:11:24 +00:00
Rich Evans
7d5a55a365 Remove dependency on sscanf in lib x509 2015-02-13 13:50:26 +00:00
Rich Evans
c8ada6d410 Fix extra guard in memory_buffer_alloc 2015-02-13 13:50:26 +00:00
Rich Evans
77d3638497 modify library/memory_buffer_alloc.c, benchmark.c and the tests main code to use polarssl_exit 2015-02-13 13:50:26 +00:00
Rich Evans
c39cb4986b add POLARSSL_PLATFORM_EXIT_ALT 2015-02-13 13:50:26 +00:00
Rich Evans
2387c7d105 modify library/debug.c to use polarssl_snprintf 2015-02-13 13:50:26 +00:00
Rich Evans
fac657fd52 modify library/x509*.c to use polarssl_snprintf 2015-02-13 13:50:25 +00:00
Rich Evans
a18b11f285 modify library/net.c to use polarssl_snprintf 2015-02-13 13:50:25 +00:00
Rich Evans
8f3a9436a9 modify oid.c to use polarssl_snprintf 2015-02-13 13:50:25 +00:00
Rich Evans
46b0a8d15a add platform_set_snprintf 2015-02-13 13:50:25 +00:00
Rich Evans
36796df815 Added missing stdio in lib x509.c needed for sscanf 2015-02-13 13:50:05 +00:00
Rich Evans
d08a605dac Remove platform guard in mem buffer alloc 2015-02-13 13:50:05 +00:00
Manuel Pégourié-Gonnard
3cfb34564f Avoid warning from mingw for shared library 2015-02-13 13:34:08 +00:00
Manuel Pégourié-Gonnard
418080010a Replace SONAME with SOVERSION in makefile
- avoids duplication
- fixes warning about redefined rule with WINDOWS=1
2015-02-13 13:15:13 +00:00
Manuel Pégourié-Gonnard
5d46cca09a Require unix-utils in path for windows make 2015-02-13 12:02:45 +00:00
Manuel Pégourié-Gonnard
d72704b0d5 Remove work-around for alleged compiler bug
It turns out the problem was with the way the reporter was invoking its
toolchain, not the toolchain itself.
2015-02-12 09:38:54 +00:00
Manuel Pégourié-Gonnard
2ee8d24ca2 Simplify some constant-time code
Some people recommend using bit operations to avoid the compiler producing a
branch on `ret != 0`, but:
- this makes the code less readable,
- here I got a warning from some compilers about unsigned unary minus
- and anyway modern compilers don't produce a branch here, checked on x64 and
  arm with various -O values.
2015-02-11 15:29:15 +00:00
Manuel Pégourié-Gonnard
06d7519697 Fix msvc warning 2015-02-11 14:54:11 +00:00
Manuel Pégourié-Gonnard
fba22fdc7e Avoid warning from ar 2015-02-11 14:24:47 +00:00
Manuel Pégourié-Gonnard
6d71e4e6c3 Fix one more warning on windows 2015-02-11 12:54:35 +00:00
Manuel Pégourié-Gonnard
dda5213982 Fix harmless warnings with mingw in timing.c 2015-02-11 12:33:40 +00:00
Manuel Pégourié-Gonnard
38433535e3 Fix hardclock() with mingw64 2015-02-11 12:33:40 +00:00
Manuel Pégourié-Gonnard
a273371fc4 Fix "int vs enum" warnings from armcc v5
enumerated type mixed with another type
2015-02-10 17:34:48 +01:00
Manuel Pégourié-Gonnard
7f84905552 Fix two warnings from armcc v5
assignment in condition
2015-02-10 17:34:35 +01:00