1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00
libsodium/.gitignore
Frank Denis 473e1718cc Add sodium_{malloc,allocarray,free}() and sodium_mprotect_*()
ptr = sodium_malloc(size) returns a pointer from which exactly "size" bytes
can be accessed.

ptr = sodium_allocarray(count, size) allocates enough storage space for
"count" pointers or scalars of unit size "size".

In both cases, the region is immediately followed by a guard page.
As a result, any attempt to access a memory location after ptr[size - 1] will
immediately trigger a segmentation fault.

The allocated region is mlock()ed and filled with 0xd0 bytes.

A read-only page with the size, a guard page, as well as a canary are
placed before the returned pointer.

The canary is checked by sodium_free(); as a result, altering data right
before ptr is likely to cause sodium_free() to kill the process.

sodium_free() munlock()s the region and fills it with zeros before
actually calling free().

sodium_mprotect_noaccess(), sodium_mprotect_readonly() and
sodium_mprotect_readwrite() can be used to change the protection on the set
of allocated pages.

Reverting the protection to read+write is not required before calling
sodium_free().
2014-08-14 21:41:05 -07:00

117 lines
1.9 KiB
Plaintext

*.cmake
*.dSYM
*.exp
*.la
*.lo
*.log
*.o
*.plist
*.scan
*.sdf
*.status
*.tar.*
*~
.DS_Store
.deps
.dirstamp
.done
.libs
Build
INSTALL
Makefile
Makefile.in
aclocal.m4
autom4te.cache
build
compile
confdefs.h
config.*
configure
depcomp
android-toolchain
install-sh
libtool
libsodium.pc
libsodium-*
ltmain.sh
m4/argz.m4
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
man/*.html
man/Makefile.in
missing
src/curvecp/curvecpclient
src/curvecp/curvecpmakekey
src/curvecp/curvecpmessage
src/curvecp/curvecpprintkey
src/curvecp/curvecpserver
src/libsodium/*.def
src/libsodium/include/sodium/version.h
stamp-*
test/default/*.res
test/default/*.trs
test/default/aead_chacha20poly1305
test/default/auth
test/default/auth2
test/default/auth3
test/default/auth5
test/default/auth6
test/default/auth7
test/default/box
test/default/box2
test/default/box7
test/default/box8
test/default/box_easy
test/default/box_easy2
test/default/box_seed
test/default/chacha20
test/default/core1
test/default/core2
test/default/core3
test/default/core4
test/default/core5
test/default/core6
test/default/ed25519_convert
test/default/generichash
test/default/generichash2
test/default/generichash3
test/default/hash
test/default/hash3
test/default/onetimeauth
test/default/onetimeauth2
test/default/onetimeauth7
test/default/pwhash
test/default/pwhash_scrypt_ll
test/default/randombytes
test/default/scalarmult
test/default/scalarmult2
test/default/scalarmult5
test/default/scalarmult6
test/default/secretbox
test/default/secretbox2
test/default/secretbox7
test/default/secretbox8
test/default/secretbox_easy
test/default/secretbox_easy2
test/default/shorthash
test/default/sign
test/default/sodium_core
test/default/sodium_utils
test/default/sodium_utils2
test/default/sodium_utils3
test/default/sodium_version
test/default/stream
test/default/stream2
test/default/stream3
test/default/stream4
test/default/verify1
test-driver
testing
android-toolchain-*
libsodium-android-*
/bin/
/obj/