Commit Graph

487 Commits

Author SHA1 Message Date
Jelmer Vernooij
70e43e9808 Fix some typos. 2014-04-25 02:42:17 +02:00
Love Hörnquist Åstrand
8a4cf0dd12 don't see anything since /dev/random doesn't really need more seeding
redhat have Linux SE rules that slows down openssh when heimdal tries
to write, so lets not write.

https://bugzilla.redhat.com/show_bug.cgi?id=1076979
2014-03-20 22:35:51 +01:00
Love Hörnquist Åstrand
6d57bb6a4a quiet warnings 2014-02-14 19:26:20 -08:00
Love Hörnquist Åstrand
7d163f234b check that e have sane values 2013-10-30 22:29:19 -07:00
Viktor Dukhovni
9a9ba1e197 Reduce RNG false positive error rate 2013-10-17 00:29:51 -04:00
Viktor Dukhovni
146f5b72e6 Link test_rand with math library.
Also deal with size_t to int casts for test_rand printf output.
2013-10-16 23:49:32 -04:00
Viktor Dukhovni
1364508cbf Hopefully fix test_rand breakage 2013-10-16 22:04:01 -04:00
Love Hornquist Astrand
1d84562886 add HDBGET: that only supports get, iteration doesnt really make sense for the HDB keytab except when dumping 2013-10-15 12:40:39 +02:00
Love Hornquist Astrand
d1eb0da071 init more of the fields 2013-10-15 12:07:02 +02:00
Jeffrey Altman
e8d2100880 libtommath: fix typo in bn_mp_mod.c
Change-Id: Ieec5c01d5bd59b9268f41933389b1b32a4c4d0c6
2013-10-08 21:32:39 -05:00
Jeffrey Altman
8dc29ae1a0 libtommath: remove bn_mp_isprime.c
Now that mp_prime() is no longer used, remove bn_mp_isprime.c from
the source tree.

Change-Id: Ie0f7ce3184c000f27ae5b9dbe07b323c02ce7199
2013-10-08 17:02:07 -05:00
Moritz Lenz
b709d39aa5 libtommath: Fix mp_mod(a, b, c) if b < 0 and a = n * b, n integer
it used to return b, now it return 0.

From https://github.com/libtom/libtommath

Change-Id: I99f5d42c09a6fbddfb32b7dd0ed10ef04f1c08a5
2013-10-08 16:17:14 -05:00
Steffen Jaeckel
7fe018e418 libtommath: mp_error_to_string: return const char* instead of char*
From https://github.com/libtom/libtommath

Change-Id: Idd5cbab380f5d504fece93afb3a5fcc026309482
2013-10-08 16:17:13 -05:00
Steffen Jaeckel
5bc653f0ef libtommath: allow mp_shrink to shrink initialized, but empty MPI's
from https://github.com/libtom/libtommath

Change-Id: I5814caeb44db710957152a7d47b03f9beb6e5147
2013-10-07 17:20:57 -05:00
Jeffrey Altman
28051fa99c Convert mp_find_prime to use mp_prime_is_prime
Modify the signature of mp_find_prime() to permit the number of
Miller-Rabin rounds to be specified.  In addition, valid responses
now include MP_NO, MP_YES, and MP_VAL which is returned when
mp_prime_is_prime() fails.

Change-Id: I0195129a4dd75875e6dddb6d49a5ceb30afb1a17
2013-10-07 15:18:42 -05:00
Jeffrey Altman
1859a85350 libtommath: protect functions by tommath_class macros
libtommath protects the inclusion of functions by wrapping their
declarations by CPP #ifdef tests and defining the matching macros
within libtommath_class.h.

Add missing macros:

  BN_MP_FIND_PRIME_C
  BN_MP_ISPRIME_C

Change-Id: Ic577300114f8e88d7a3af3d9f717a249d57f03b1
2013-10-07 14:00:21 -05:00
Jeffrey Altman
b90732860a libtommath: remove unnecessary comparison
As pointed out by Steffen Jaeckel [https://github.com/sjaeckel],
within bn_mp_prime_next_prime() t <= PRIME_SIZE as per the check
at the top of the function.  Remove the unnecessary comparison in
a for loop conditional.

Change-Id: I868bee1a7a019e0ab06bf2b81cc71cf66ca9acff
2013-10-07 13:57:03 -05:00
Jeffrey Hutzelman
db8f03740a hcrypto/rand-unix.c: Ignore write(2) result harder
unix_seed(), called by the add-seed-data op unix_add(), attempts to
write seed data to the random data device.  If this fails, the failure
is ignored, as it must be, since there is no way to inform the caller.

This change modifies the way in which the return value from write(2)
is ignored, to avoid compiler warnings when building on Ubuntu 12.10,
with gcc 4.7.2 and eglibc 2.15-0ubuntu20.1.
2013-06-18 22:40:49 -04:00
Love Hornquist Astrand
4256823e58 memset right size 2013-04-29 21:59:11 -07:00
Love Hornquist Astrand
e91bd34275 add rsa_keygen initializer 2013-04-29 12:03:42 -07:00
Love Hornquist Astrand
ed87e9b33a use after free 2012-11-27 21:58:04 -08:00
Love Hörnquist Åstrand
9ad763288d fix -Wshadow 2012-11-17 14:14:52 -08:00
Simon Wilkinson
10133ece1a hcrypto: Use correct size for memset in md2
md2.c was doing memset(m, 0, sizeof(m)), and so was only clearing
the first 4 bytes of the passed md2 structure in MD2_Final. Fix
this to clear the entire structure, as expected.
2012-03-31 19:06:59 -04:00
Love Hornquist Astrand
8a0e0f9472 do m-r on more then one prime 2011-11-21 20:33:53 -08:00
Love Hornquist Astrand
308be3a9e2 Don't export tests from library, reported in bug from Tom Payeire 2011-09-26 17:53:13 +02:00
Love Hornquist Astrand
6b5cc16d5d use -r instead of -e to please solaris test 2011-09-23 13:17:05 +02:00
Love Hornquist Astrand
df1e4c388a send output to /dev/null from cmp since the output should always be different 2011-09-23 13:08:54 +02:00
Jeffrey Altman
63b3cb9749 Windows: fallback to PROV_RNG if no PROV_RSA_FULL
Heimdal can be executed in environments in which the user
account profile is not loaded.  In such environments it is
not possible to use PROV_RSA_FULL as it stores required
data within the profile.  Instead, fallback to PROV_RNG which
does not store data within the profile and can be used to access
secure random number generator routines.

Change-Id: If600246f39645ed6bf5af0dd237f5adfddcf6c0c
2011-09-20 16:17:42 -04:00
chas williams - CONTRACTOR
b118610a9c hcrypto: var name current conflicts with linux kernel
on a big endian machine, usage of this file in the kernel
is somewhat troublesome since the linux kernel already has
a well known global/#define called current.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-09-09 10:08:34 +02:00
Love Hörnquist Åstrand
d434bda588 make sure keylen is a multiple of 2 2011-07-24 12:34:51 -07:00
Love Hörnquist Åstrand
12403a31ce sprinkle more windows files 2011-07-23 11:18:21 -07:00
Love Hörnquist Åstrand
7aaba443bc add NTMakefile and windows directories 2011-07-17 12:16:59 -07:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Jeffrey Altman
6850d6a65f avoid uninit variable and unreachable code warnings
most of these warnings are not problems because of ample
use of abort() calls.  However, the large number of warnings
makes it difficult to identify real problems.  Initialize
the variables to shut up the compilers.

Change-Id: I8477c11b17c7b6a7d9074c721fdd2d7303b186a8
2011-05-17 12:02:16 -04:00
Asanka C. Herath
b755dc12f4 Windows: Fix hcrypto tests on cygwin 2010-11-29 10:53:50 -05:00
Asanka C. Herath
6d662f71d7 Windows: Fix export lists 2010-11-29 10:53:49 -05:00
Love Hornquist Astrand
db7f598466 return size is a int, don't pretend. 2010-11-27 12:37:49 -08:00
Love Hornquist Astrand
104033874d provide symbol renameing for sha512 and sha384 2010-11-26 10:05:58 -08:00
Love Hornquist Astrand
60a7783024 export more 2010-11-26 09:15:23 -08:00
Asanka C. Herath
3855dd33bd Windows: Catch up with hcrypto changes 2010-11-24 15:32:31 -05:00
Asanka C. Herath
dd99c2054c Windows: Add missing hcrypto dependencies and exports 2010-11-24 15:32:25 -05:00
Simon Wilkinson
5b91f58f35 hcrypto: Remove getarg.h include from validate.c
None of the functions prototyped in getarg.h are used by validate.c,
so simplify out-of-tree builds by removing the header from the file.
2010-11-24 10:55:27 +00:00
Love Hornquist Astrand
bbe08b7750 use clear_multi, don't call init twice 2010-10-27 22:19:22 -07:00
Love Hornquist Astrand
6d47c862ec really free memory too 2010-10-27 22:13:04 -07:00
Love Hornquist Astrand
b7ac4c9333 really free memory too 2010-10-27 22:12:30 -07:00
Love Hornquist Astrand
acbdbb753e plug memory leaks 2010-10-27 22:03:36 -07:00
Chas Williams (CONTRACTOR)
a3afa695ee hcrypto: struct x64 doesn't need bitfields
hcrypto: struct x64 doesn't need bitfields

    The bitfield specifications on the struct x64 members do not actually do
    anything to guarantee/force packing or endian of the members.  Removing
    them allows the code to compile on certain compilers that do not support
    bitfields on 64-bit types.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-10-23 17:24:28 -07:00
Love Hornquist Astrand
8e7cf16491 Switch to ULL 2010-10-11 20:15:37 -07:00
Love Hornquist Astrand
f5b16cbddb remove tfm 2010-10-11 20:10:24 -07:00
Simon Wilkinson
4dc6b5f259 hcrypto: Flag 64bit bit constants as long long
When using 64bit constants for initialisation flag them as LL, so
the compiler doesn't try to cast them down to a long, and throw away
information, on 32 bit platforms.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-10-11 20:08:25 -07:00