Commit Graph

475 Commits

Author SHA1 Message Date
Tom Li 7da94ce028 Merge branch 'access' into github 2019-01-04 01:54:06 +08:00
Tom Li 538d26900b
hash.h: fix std::vector access violation.
Signed-off-by: Tom Li <tomli@tomli.me>
2019-01-04 01:52:54 +08:00
Tom Li a5a1d6190c
keyring.cpp: fix std::vector access violation
Signed-off-by: Tom Li <tomli@tomli.me>
2019-01-04 01:50:17 +08:00
Tom Li 81821562e3
travis.yml: add simple build test.
Signed-off-by: Tom Li <tomli@tomli.me>
2019-01-04 01:26:12 +08:00
Tom Li 025a958a20
cube_hash.h: finalize CubeHash if there's no incomplete block.
Previously, we assume the existence of a incomplete block at
end of the input. However, it's possible that input's an exact
multiple of block size. In this case, the first argument of
process_final_incomplete_block() will be one-past-the-last
element, the second argument will be zero. This' an ill-defined
call, and it will trigger an assertion failure of std::vector

Assertion '__builtin_expect(__n < this->size(), true)' failed.

This commit introduced a check. If we see the length of the last
incomplete block is zero, we call

    process_final_incomplete_block(NULL, 0);

which immediately finalizes CubeHash without hashing additional
data.

Signed-off-by: Tom Li <tomli@tomli.me>
2019-01-03 21:32:11 +08:00
Tom Li 29f7826b1e
cubehash_impl.h: finalize without an incomplete block.
Currently, process_final_incomplete_block() will perform the round
R calculation with the remaining data, then finalize CubeHash. It
is not possible to finalize CubeHash if there's no incomplete block.

Here, we define the call of process_final_incomplete_block(NULL, 0)
as a way to directly finalize CubeHash when input is a multiple of
block size and there is no remaining data for round R.

Also, in this case, any call of process_final_incomplete_block(),
but only with a single NULL pointer, or only with n == 0, is an
indication of bug. We assert both to be zero/nonzero.

Signed-off-by: Tom Li <tomli@tomli.me>
2019-01-03 21:18:21 +08:00
Tom Li 7021f6c734
sc.h: correct access violation in load_key_vector(), close #2.
In load_key_vector(), the program passes a std::vector<byte> to
a C-style function, load_key (const byte*begin, const byte*end)
by creating references

    load_key (& (K[0]), & (K[K.size()]));

However, accessing the one-past-the-last element in a std::vector
via [] is not allowed in C++, it triggers an assertion failure.

    Assertion '__builtin_expect(__n < this->size(), true)' failed.

In this commit, we use K.data() and K.data() + K.size() to expose
the underlying pointers and pass them to the C function.

Signed-off-by: Tom Li <tomli@tomli.me>
2019-01-02 11:42:04 +08:00
Mirek Kratochvil 4441f8e514 document existing python bindings 2018-10-18 14:37:48 +02:00
Mirek Kratochvil c3f926b759 add windows port info 2018-10-03 10:46:10 +02:00
Mirek Kratochvil 59af6b2ae8 produce a conf-time warning if using getpass(3) 2018-05-28 14:11:57 +02:00
Mirek Kratochvil f0ecdcd9c9 autogen.sh: produce better Makefile.am 2018-05-28 14:11:02 +02:00
Mirek Kratochvil e615d48732 Merge 'amynka/cfg', better autotools autotooling 2018-05-28 13:46:17 +02:00
amynka@gentoo.org 1b1b07d9e6 Buildsystem improvements
- Adding Makefile.am
- Fixing configure.ac hacks
- Cleaning configure.ac
2018-05-21 15:51:46 +02:00
Mirek Kratochvil 58c8beefd2 Merge branch 'cmake' 2018-02-01 10:21:51 +01:00
Mirek Kratochvil fb616a748e CMakeLists commentary 2018-02-01 10:21:31 +01:00
Mirek Kratochvil d7362a0e5b keep .gitignore sorted and complete 2018-02-01 10:11:07 +01:00
tearsofphoenix 4a00aec0b9 add support for CMake
Note that the CMakeLists.txt file is not included in autotools dist package to
avoid any packaging confusion. `configure.ac` is still the primary
build-configuration information source. (Btw isn't there a way to build
CMakeLists.txt from autotools?)
2018-02-01 10:10:57 +01:00
Mirek Kratochvil 91b12452d6 update docs 2017-12-15 16:26:26 +01:00
Mirek Kratochvil 25cb1f081d contribution guide 2017-11-22 09:32:40 +01:00
Mirek Kratochvil 0e541c4fbf version bump to 1.8
bemp.
2017-10-31 21:42:06 +01:00
Mirek Kratochvil 66d5488133 privfile: add forgotten sources 2017-10-31 21:34:38 +01:00
Mirek Kratochvil 8a55068d89 configure.ac: check for pkg-config when using it 2017-10-27 10:41:40 +02:00
Mirek Kratochvil df3ed069d7 README: someone added a comma here 2017-10-23 22:23:19 +02:00
Mirek Kratochvil 65c2bcc546 man: document the -u defaulting 2017-10-23 16:33:04 +02:00
Mirek Kratochvil 798de9f70a update docs 2017-10-23 14:56:02 +02:00
Mirek Kratochvil 76fb3b059d main: default -u from CCR_USER env 2017-10-23 14:33:47 +02:00
Mirek Kratochvil c27285e750 actions: only show 40 bits of keyID by default
It must be enough for everyone! It also copypastes better and is short enough
not to provide a false feeling of security.
2017-10-23 14:32:10 +02:00
Mirek Kratochvil 5dceb7c07d styleup 2017-10-23 14:17:35 +02:00
Mirek Kratochvil 4f2680134e privfile: common sk/pk file creation/saving code 2017-10-23 14:14:26 +02:00
Mirek Kratochvil 7ec0823834 keyring: fix forgotten check 2017-10-23 14:13:49 +02:00
Mirek Kratochvil 104ee12951 implement private key locking
Included:
- gazillion changes in actions
- keyring decodes privkey structures lazily, if not needed they will
  pass by as strings
2017-10-22 23:10:23 +02:00
Mirek Kratochvil 7b0bc06d45 add forgotten seclock files
whew boy.
2017-10-22 21:12:57 +02:00
Mirek Kratochvil 578691f45e secret-locking on symmetric keys 2017-10-22 21:00:58 +02:00
Mirek Kratochvil c0770926e9 configure.ac: it was a bit too verbose 2017-10-22 21:00:58 +02:00
Mirek Kratochvil 3f378e14d7 readme: typo 2017-08-04 08:52:50 +02:00
Mirek Kratochvil 0d772da18c Merge tag 'v1.7.6' 2017-07-12 16:24:59 +02:00
Mirek Kratochvil 4f4e4f4df9 minor typos and styles
Actually, debian lintian told me that:

I: codecrypt: spelling-error-in-manpage
   usr/share/man/man1/ccr.1.gz overriden overridden

Isn't that cute?
2017-07-12 16:10:59 +02:00
Mirek Kratochvil 33a9c14661 Merge branch 'master' of github.com:exaexa/codecrypt 2017-07-12 15:08:09 +02:00
Mirek Kratochvil 8dd84892ef README: update debian information 2017-07-12 15:06:33 +02:00
Mirek Kratochvil e5b8b4bc82 version bump to 1.7.6 2017-07-10 12:40:37 +02:00
Mirek Kratochvil cc9b6b5858 base64: simplify debase64ing a bit 2017-07-10 11:17:34 +02:00
Mirek Kratochvil be8c3faa55 arcfour: register keyword is deprecated now 2017-07-10 11:13:10 +02:00
Mirek Kratochvil ad40fbe5dc keyring: write backup before actually touching keys 2017-06-26 14:30:07 +02:00
Mirek Kratochvil dc3a874cd5 generator: allow own PRNG seed source 2017-06-26 14:28:54 +02:00
Mirek Kratochvil d53586d582 remove obsolete qd_utils header 2017-04-25 12:15:06 +02:00
Mirek Kratochvil d7dc743016 Merge branch 'master' of github.com:exaexa/codecrypt 2016-10-18 21:02:18 +02:00
Mirek Kratochvil ac2047a915 Merge pull request #19 from mapmeld/mac
run glibtoolize on OSX
2016-10-18 21:01:13 +02:00
Nick Doiron cadaadac73 run glibtoolize on OSX 2016-10-18 13:12:33 -04:00
Mirek Kratochvil 87337db922 README: add explicit key distribution notice 2016-06-13 08:50:29 +02:00
Mirek Kratochvil 0bd9ab6d54 hashfile: avoid being fine with informative-grade hashes only 2016-04-28 21:58:52 +02:00