Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7fd93112e | ||
|
|
1d100ffb76 | ||
|
|
0cf03528c5 |
59
.gitignore
vendored
Normal file
59
.gitignore
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
*.o
|
||||
*.lo
|
||||
*.a
|
||||
*.la
|
||||
*.dirstamp
|
||||
*.pc
|
||||
*.log
|
||||
*.trs
|
||||
TAGS
|
||||
tags
|
||||
core*
|
||||
|
||||
# autoconf output
|
||||
autom4te.cache
|
||||
*.in
|
||||
!/src/libemsha-1.pc.in
|
||||
config.*
|
||||
compile
|
||||
*.m4
|
||||
configure
|
||||
depcomp
|
||||
*.info
|
||||
mdate-sh
|
||||
stamp-*
|
||||
texinfo.tex
|
||||
version.texi
|
||||
install-sh
|
||||
missing
|
||||
Makefile
|
||||
.deps
|
||||
.libs
|
||||
libtool
|
||||
ltmain.sh
|
||||
|
||||
RELEASE_NOTES
|
||||
debian/files
|
||||
debian/libemsha-1.postinst.debhelper
|
||||
debian/libemsha-1.postrm.debhelper
|
||||
debian/libemsha-1.substvars
|
||||
debian/libemsha-1/
|
||||
debian/libemsha-dev.substvars
|
||||
debian/libemsha-dev/
|
||||
debian/shlibs.local
|
||||
debian/source/
|
||||
debian/tmp/
|
||||
doc/source/header.dated.rst
|
||||
doc/source/header.rst
|
||||
src/cov-int/
|
||||
src/emsha_core_test
|
||||
src/emsha_hmac_test
|
||||
src/emsha_mem_test
|
||||
src/emsha_sha256_test
|
||||
src/emsha_static_hmac_test
|
||||
src/emsha_static_mem_test
|
||||
src/emsha_static_sha_test
|
||||
src/libemsha.tgz
|
||||
doc/source/conf.py
|
||||
/test-driver
|
||||
do-release
|
||||
@@ -12,6 +12,7 @@ addons:
|
||||
- clang
|
||||
- python-sphinx
|
||||
- python-sphinx-rtd-theme
|
||||
- pkg-config
|
||||
install:
|
||||
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
|
||||
script: "./autobuild && ./do-release"
|
||||
|
||||
13
CHANGELOG
13
CHANGELOG
@@ -1,5 +1,18 @@
|
||||
LIBEMSHA CHANGELOG
|
||||
==================
|
||||
|
||||
1.0.2 (2015-01-28):
|
||||
|
||||
Added:
|
||||
+ Build now includes pkg-config.
|
||||
+ Debian packaging source files added.
|
||||
|
||||
------------------
|
||||
1.0.1 (2015-12-22):
|
||||
|
||||
Fixed:
|
||||
+ hash_equal was improperly performing its comparison.
|
||||
|
||||
------------------
|
||||
1.0.0 (2015-12-18):
|
||||
Initial release.
|
||||
|
||||
@@ -24,7 +24,7 @@ The source code is available via `Github
|
||||
git clone https://github.com/kisom/libemsha
|
||||
git clone git@github.com:kisom/libemsha
|
||||
|
||||
The current release is `1.0.0 <https://github.com/kisom/libemsha/archive/1.0.0.zip>`_.
|
||||
The current release is `1.0.1 <https://github.com/kisom/libemsha/releases/tag/v1.0.1>`_.
|
||||
|
||||
The project is built using Autotools and ``make``.
|
||||
|
||||
|
||||
10
TODO.rst
10
TODO.rst
@@ -2,12 +2,12 @@
|
||||
TODO
|
||||
====
|
||||
|
||||
[ ] Documentation for ``HMAC``
|
||||
[*] Documentation for ``HMAC``
|
||||
|
||||
[ ] Documentation for miscellaneous functions
|
||||
[*] Documentation for miscellaneous functions
|
||||
|
||||
[ ] Travis with static analysers
|
||||
[*] Travis with static analysers
|
||||
|
||||
[ ] Coverity?
|
||||
[ ] cppcheck
|
||||
[*] Coverity?
|
||||
[*] cppcheck
|
||||
|
||||
|
||||
@@ -2,17 +2,18 @@
|
||||
# versions that can be used with Travis right now.
|
||||
AC_PREREQ([2.68])
|
||||
AC_INIT([libemsha],
|
||||
[1.0.0],
|
||||
[1.0.2],
|
||||
[coder@kyleisom.net],
|
||||
[libemsha],
|
||||
[https://kyleisom.net/projects/libemsha/])
|
||||
AM_INIT_AUTOMAKE([1.11 foreign])
|
||||
|
||||
AC_CONFIG_SRCDIR([src/emsha/sha256.hh])
|
||||
AC_CONFIG_FILES([Makefile src/Makefile doc/source/conf.py doc/source/header.rst])
|
||||
AC_CONFIG_FILES([Makefile src/Makefile doc/source/conf.py doc/source/header.rst src/libemsha-1.pc])
|
||||
AC_CONFIG_FILES([do-release], [chmod +x do-release])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
PKG_PROG_PKG_CONFIG
|
||||
AC_CHECK_HEADERS
|
||||
|
||||
LT_INIT
|
||||
|
||||
17
debian/changelog
vendored
Normal file
17
debian/changelog
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
libemsha (1.0.2-2) stable; urgency=medium
|
||||
|
||||
* Package bump to fix dependency issues.
|
||||
|
||||
-- Kyle Isom <kyle@imap.cc> Thu, 28 Jan 2016 00:49:45 -0800
|
||||
|
||||
libemsha (1.0.2-1) stable; urgency=medium
|
||||
|
||||
* Add pkg-config to build.
|
||||
|
||||
-- Kyle Isom <kyle@imap.cc> Thu, 28 Jan 2016 00:27:31 -0800
|
||||
|
||||
libemsha (1.0.1-1) unstable; urgency=low
|
||||
|
||||
* Initial release for packaging.
|
||||
|
||||
-- Kyle Isom <kyle@imap.cc> Wed, 27 Jan 2016 21:19:12 -0800
|
||||
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
@@ -0,0 +1 @@
|
||||
9
|
||||
28
debian/control
vendored
Normal file
28
debian/control
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
Source: libemsha
|
||||
Priority: optional
|
||||
Maintainer: Kyle Isom <kyle@imap.cc>
|
||||
Build-Depends: debhelper (>= 9), autotools-dev
|
||||
Standards-Version: 3.9.5
|
||||
Section: libs
|
||||
Homepage: https://git.kyleisom.net/lib/libemsha
|
||||
Vcs-Git: https://git.kyleisom.net/lib/libemsha
|
||||
Vcs-Browser: https://git.kyleisom.net/lib/libemsha
|
||||
|
||||
Package: libemsha-dev
|
||||
Section: libdevel
|
||||
Architecture: any
|
||||
Depends: libemsha-1 (= ${binary:Version}), ${misc:Depends}
|
||||
Description: HMAC-SHA-256 C++11 library - development files
|
||||
An MIT-licensed HMAC-SHA-256 C++11 library designed for embedded
|
||||
systems. It is built following the JPL Power of Ten rules. It was written
|
||||
in response to a need for a standalone HMAC-SHA-256 package that could
|
||||
run on several platforms.
|
||||
|
||||
Package: libemsha-1
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: HMAC-SHA-256 C++11 library
|
||||
An MIT-licensed HMAC-SHA-256 C++11 library designed for embedded
|
||||
systems. It is built following the JPL Power of Ten rules. It was written
|
||||
in response to a need for a standalone HMAC-SHA-256 package that could
|
||||
run on several platforms.
|
||||
26
debian/copyright
vendored
Normal file
26
debian/copyright
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: libemsha
|
||||
Source: https://git.kyleisom.net/lib/libemsha
|
||||
|
||||
Files: *
|
||||
Copyright: <years> <put author's name and email here>
|
||||
<years> <likewise for another author>
|
||||
License: MIT
|
||||
2015 K. Isom <coder@kyleisom.net>
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
.
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
3
debian/libemsha-1.docs
vendored
Normal file
3
debian/libemsha-1.docs
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
README.rst
|
||||
TODO.rst
|
||||
doc/libemsha.rst
|
||||
2
debian/libemsha-1.install
vendored
Normal file
2
debian/libemsha-1.install
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
usr/lib/*/lib*.so.*
|
||||
usr/lib/*/lib*.a
|
||||
1
debian/libemsha-dev.dirs
vendored
Normal file
1
debian/libemsha-dev.dirs
vendored
Normal file
@@ -0,0 +1 @@
|
||||
usr/include
|
||||
2
debian/libemsha-dev.install
vendored
Normal file
2
debian/libemsha-dev.install
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
usr/include/*
|
||||
usr/lib/*/pkgconfig/*
|
||||
32
debian/rules
vendored
Executable file
32
debian/rules
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/make -f
|
||||
# See debhelper(7) (uncomment to enable)
|
||||
# output every command that modifies files on the build system.
|
||||
#DH_VERBOSE = 1
|
||||
|
||||
# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
|
||||
DPKG_EXPORT_BUILDFLAGS = 1
|
||||
include /usr/share/dpkg/default.mk
|
||||
|
||||
# see FEATURE AREAS in dpkg-buildflags(1)
|
||||
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||
|
||||
# see ENVIRONMENT in dpkg-buildflags(1)
|
||||
# package maintainers to append CFLAGS
|
||||
#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
|
||||
# package maintainers to append LDFLAGS
|
||||
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
|
||||
|
||||
|
||||
# main packaging script based on dh7 syntax
|
||||
%:
|
||||
dh $@ --with autotools-dev
|
||||
|
||||
# debmake generated override targets
|
||||
# This is example for Cmake (See http://bugs.debian.org/641051 )
|
||||
#override_dh_auto_configure:
|
||||
# dh_auto_configure -- \
|
||||
# -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
libemsha
|
||||
========
|
||||
|
||||
Version: 1.0.0
|
||||
Version: 1.0.2
|
||||
|
||||
Date: 2015-12-22
|
||||
Date: 2016-01-28
|
||||
|
||||
|
||||
-----------------
|
||||
|
||||
@@ -7,6 +7,8 @@ CLOC_PSOURCES = emsha.cc sha256.cc hmac.cc internal.hh \
|
||||
emsha/emsha.hh emsha/hmac.hh emsha/sha256.hh
|
||||
CLOC_TSOURCES = test_emsha.cc test_hmac.cc test_mem.cc test_sha256.cc \
|
||||
test_utils.cc test_utils.hh
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libemsha-1.pc
|
||||
|
||||
lib_LTLIBRARIES = libemsha.la
|
||||
nobase_include_HEADERS = emsha/sha256.hh emsha/hmac.hh emsha/emsha.hh
|
||||
|
||||
@@ -55,7 +55,7 @@ hash_equal(const uint8_t *a, const uint8_t *b)
|
||||
EMSHA_CHECK(b != NULL, false);
|
||||
|
||||
for (uint32_t i = 0; i < SHA256_HASH_SIZE; i++) {
|
||||
res = a[i] ^ b[i];
|
||||
res += a[i] ^ b[i];
|
||||
}
|
||||
|
||||
return res == 0;
|
||||
|
||||
10
src/libemsha-1.pc.in
Normal file
10
src/libemsha-1.pc.in
Normal file
@@ -0,0 +1,10 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: @PACKAGE_NAME@
|
||||
Description: C++11 HMAC-SHA256 library
|
||||
URL: @PACKAGE_URL@
|
||||
Version: @PACKAGE_VERSION@
|
||||
Libs: -L${libdir} -Wl,-rpath,${libdir} -lemsha
|
||||
@@ -106,6 +106,29 @@ hash_equal_test(void)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// This catches the bug in the initial version where the code was
|
||||
// res = a[i] ^ b[i];
|
||||
// instead of
|
||||
// res += a[i] ^ b[i];
|
||||
for (uint32_t i = 0; i < emsha::SHA256_HASH_SIZE; i++) {
|
||||
a[i] = static_cast<uint8_t>(i);
|
||||
b[i] = static_cast<uint8_t>(i+1);
|
||||
}
|
||||
|
||||
b[emsha::SHA256_HASH_SIZE - 1]--;
|
||||
if (emsha::hash_equal(a, b)) {
|
||||
string s;
|
||||
cerr << "FAILED: hash_equal\n";
|
||||
cerr << "\tREGRESSION: hash_equal should not have succeeded comparing a and b.\n";
|
||||
dump_hexstring(s, a, emsha::SHA256_HASH_SIZE);
|
||||
cerr << "\ta <- " << s << std::endl;
|
||||
dump_hexstring(s, b, emsha::SHA256_HASH_SIZE);
|
||||
cerr << "\tb <- " << s << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
cout << "PASSED: hash_equal\n";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user