Skip to content

Commit ab130d7

Browse files
committed
New release v04102017 3.0
1 parent 6e5144e commit ab130d7

File tree

2 files changed

+44
-37
lines changed

2 files changed

+44
-37
lines changed

ChangeLog

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
ChangeLog file for safeclib
33

4-
Changes in vxx092017 3.0.0
4+
Changes in v04102017 3.0.0
55
- Added mingw cross-compilation support and changes.
66
The MINGW_HAS_SECURE_API deviates in strtok_s, vsnprintf_s, wcstok_s
77
from C11 in w64, and in vswprintf for w32. (!__STRICT_ANSI__).
@@ -23,11 +23,12 @@ Changes in vxx092017 3.0.0
2323
plus all the new C11 functions.
2424
defines SAFECLIB_DISABLE_EXTENSIONS
2525
- Rearranged src layout
26-
- Macrofied many more tests
26+
- Macrofied many more tests, add CHECK_SLACK, errnot_t return and ERRNO checks.
2727
- Improved some tests for old gcc -ansi (c89) memcmp
2828
- Add unlikely() to improve branch prediction
2929
- Added --enable-gcov and a gcov target. lcov support not yet,
30-
but via gcov2perl and some fixups essentially the same. see build-tools/smoke.sh
30+
but via gcov2perl and some fixups essentially the same. See build-tools/smoke.sh
31+
- Added a check-valgrind make target with support for BSD make
3132
- Added all missing safe wchar and multibyte string C11 functions:
3233
mbsrtowcs_s, mbstowcs_s, wcsrtombs_s, wcstombs_s, wcrtomb_s,
3334
wctomb_s, wcsnlen_s, wcscpy_s, wcsncpy_s, wcscat_s, wcsncat_s,
@@ -49,14 +50,24 @@ Changes in vxx092017 3.0.0
4950
- Better debugging support: add .i target
5051
- Fixed memset32_s for n > RSIZE_MAX_MEM32 ESLEMAX,
5152
was only RSIZE_MAX_MEM16.
52-
- Added the wcsfc_s and wcsnorm_s extensions to be able to compare wide
53+
- Added the wcsfc_s, wcsnorm_s, wcsicmp_s extensions to be able to compare wide
5354
strings.
5455
- Added --enable-norm-compat to enable the big compatbility modes NFKD, NFKC
5556
for wcsnorm_s.
5657
- Added the timingsafe_bcmp and timingsafe_memcmp extensions from OpenBSD,
5758
and memccpy_s derived from FreeBSD.
5859
- Changed strtok_s to set errno to ES* values. C11 does nothing,
5960
but with wcstok_s sets errno to EINVAL.
61+
- Changed memset_s, harmonized with C11 API
62+
- Changed mem{cpy,move,set}_s with smax/n=0, dependent if compiled with
63+
a C11 compiler or not.
64+
- Added a C11 compiler probe from latest autoconf git.
65+
- Eliminated str/mem/lib inclusion loops. You need to include the right header(s).
66+
- Clarify return values for {str,wcs}tok_s
67+
- Negative return error values for all printf functions,
68+
Make clear that errno is not set with _s violations, only the underlying
69+
system call sets it. (EINVAL, EOVERFLOW, EILSEQ, EOF)
70+
- Updated from autoconf 2.68 to 2.69
6071

6172
Changes in v30082017 2.1.1
6273
- Added vsprintf_s, vsnprintf_s. They are C11.

README

+29-33
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ _s variants in the Annex K. The Microsoft Windows/MINGW secure API did the
5757
same, but deviated in some functions from the standard. Besides
5858
Windows only Android's Bionic and Embarcadero implemented this C11
5959
secure Annex K API so far.
60-
They are still missing from glibc, musl, FreeBSD and DragonFly libc,
61-
OpenBSD libc, newlib, dietlibc, uClibc, minilibc.
62-
60+
They are still missing from glibc, musl, FreeBSD, darwin and DragonFly
61+
libc, OpenBSD libc, newlib, dietlibc, uClibc, minilibc.
6362

6463
Design Considerations
6564
---------------------
@@ -70,7 +69,7 @@ to provide a complementary set of functions with like behavior.
7069
This library is meant to be used on top of all the existing libc's
7170
which miss the secure C11 functions. Of course tighter integration
7271
into the system libc would be better, esp. with the printf, scanf and
73-
IO functions. See the seperate libc-overview.md document.
72+
IO functions. See the seperate [libc-overview](doc/libc-overview.md) document.
7473

7574
Austin Group Review of ISO/IEC WDTR 24731
7675
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1106.txt
@@ -81,15 +80,15 @@ http://en.cppreference.com/w/c
8180
Stackoverflow discussion:
8281
https://stackoverflow.com/questions/372980/do-you-use-the-tr-24731-safe-functions
8382

84-
=== Use of errno
83+
* Use of errno
8584

8685
The TR24731 specification says an implementation may set errno for the
8786
functions defined in the technical report, but is not required to. This
8887
library does not set errno. The library does use errno return codes as
8988
required by functional APIs. Specific Safe C String and Safe C Memory errno
9089
codes are defined in the safe_errno.h file.
9190

92-
=== Runtime-constraints
91+
* Runtime-constraints
9392

9493
Per the spec, the library verifies that the calling program does not violate
9594
the function's runtime-constraints. If a runtime-constraint is violated, the
@@ -115,16 +114,16 @@ RSIZE_MAX::
115114
range limit for the safe string functions. RSIZE_MAX_MEM defines the
116115
range limit for the safe memory functions. The point is that string
117116
limits can and should be different from memory limits.
117+
There also exist RSIZE_MAX_WSTR, RSIZE_MAX_MEM16, RSIZE_MAX_MEM32.
118118

119119

120-
=== Header Files
120+
* Header Files
121121

122122
The specification states the various functions would be added to existing
123123
Standard C header files: stdio.h, string.h, etc. This implementation
124-
separates the memory related functions into the safe_mem_lib.h header and the
125-
string related functions into the safe_str_lib.h header.
126-
You can optionally use the safe_lib.h header to include also non str/mem
127-
functions.
124+
separates the memory related functions into the safe_mem_lib.h header, the
125+
string related functions into the safe_str_lib.h header, and the rest into
126+
the safe_lib.h header.
128127

129128
The make file builds a single library libsafec-VERSION.a and .so in the
130129
src/.libs directory.
@@ -145,33 +144,32 @@ library to be built on a wide variety of platforms. See the
145144
xref:tested-platforms[``Tested Platforms''] section for details on what
146145
platforms this library was tested on during its development.
147146

147+
Note that the library will behave differently if built with a C11 compiler
148+
or not. With C11 mem{cpy,move,set}_s smax/n=0 is allowed, before not.
148149

149-
=== Building
150+
* Building
150151

151152
For those familiar with autotools you can probably skip this part. For those
152153
not and want to get right to building the code see below. And, for those that
153154
need additional information see the 'INSTALL' file in the same directory.
154155

155156
.To build you do the following:
156-
----
157-
prompt$ ./build-tools/autogen.sh
158-
prompt$ ./configure
159-
prompt$ make
160-
----
157+
158+
$ ./build-tools/autogen.sh
159+
$ ./configure
160+
$ make
161+
161162
'autogen.sh' only needs to be run if you are building from the git
162163
repository. Optionally, you can do ``make check'' if you want to run the unit
163164
tests.
164165

165166

166-
=== Installing
167+
* Installing
167168

168169
Installation must be preformed by `root`, an `Administrator' on most
169170
systems. The following is used to install the library.
170171

171-
----
172-
prompt$ sudo make install
173-
----
174-
172+
$ sudo make install
175173

176174
Safe Linux Kernel Module
177175
------------------------
@@ -180,13 +178,13 @@ build infrastructure. Consequently, you have to run a different makefile to
180178
build the kernel module.
181179

182180

183-
=== Building
181+
* Building
184182

185183
.To build do the following:
186-
----
187-
prompt$ ./configure
188-
prompt$ make -f Makefile.kernel
189-
----
184+
185+
$ ./configure
186+
$ make -f Makefile.kernel
187+
190188

191189
This assumes you are compiling on a Linux box and this makefile supports the
192190
standard kernel build system infrastructure documented in:
@@ -197,7 +195,7 @@ NOTE: If you build the kernel module then wish to build the userspace library
197195
will fail to build.
198196

199197

200-
=== Installing
198+
* Installing
201199

202200
The kernel module will be found at the root of the source tree called
203201
'slkm.ko'. The file 'testslkm.ko' are the unit tests run on the userspace
@@ -208,9 +206,10 @@ kernel.
208206
[[tested-platforms]]
209207
Tested Platforms
210208
----------------
209+
211210
.The library has been tested on the following systems
212211
- Mac OS X 10.6-11 w/ Apple developer tools and macports (gcc+clang)
213-
- Linux Debian 10 amd64 glibc 2.24
212+
- Linux Debian 10 amd64/i386 glibc 2.24
214213
- Linux Void amd64 musl-1.1.16
215214
- x86_64-w64-mingw32, i686-w64-mingw32 cross-compiled and tested under wine
216215
- i386-mingw32 cross-compiled and tested under wine
@@ -224,10 +223,7 @@ Known Issues
224223
------------
225224
1. If you are building the library from the git repository you will have to
226225
first run build-tools/autogen.sh which runs autoreconf to ``install'' the
227-
autotools files and create the configure script. On Mac OSX you may see a
228-
warning about ``AC_FOREACH is obsolete'' this can be ignored as the library
229-
will still build correctly.
230-
226+
autotools files and create the configure script.
231227

232228
[bibliography]
233229
.References

0 commit comments

Comments
 (0)