Jeffrey Altman
93518bfab4
use memset_s
...
lib roken includes support for memset_s() but it was not applied
to the Heimdal source tree.
Change-Id: I8362ec97a9be50205bb2d398e65b629b88ce1acd
2017-04-29 01:05:59 -04:00
Nicolas Williams
3ba12317a0
Misc fixes (coverity)
2016-11-28 15:09:55 -06:00
Nicolas Williams
490337f4f9
Make OpenSSL an hcrypto backend proper
...
This adds a new backend for libhcrypto: the OpenSSL backend.
Now libhcrypto has these backends:
- hcrypto itself (i.e., the algorithms coded in lib/hcrypto)
- Common Crypto (OS X)
- PKCS#11 (specifically for Solaris, but not Solaris-specific)
- Windows CNG (Windows)
- OpenSSL (generic)
The ./configure --with-openssl=... option no longer disables the use of
hcrypto. Instead it enables the use of OpenSSL as a (and the default)
backend in libhcrypto. The libhcrypto framework is now always used.
OpenSSL should no longer be used directly within Heimdal, except in the
OpenSSL hcrypto backend itself, and files where elliptic curve (EC)
crypto is needed.
Because libhcrypto's EC support is incomplete, we can only use OpenSSL
for EC. Currently that means separating all EC-using code so that it
does not use hcrypto, thus the libhx509/hxtool and PKINIT EC code has
been moved out of the files it used to be in.
2016-04-15 00:16:17 -05:00
Love Hornquist Astrand
029de6cfa4
pass back an heim_error from hx509_cert_init
2012-10-07 06:33:13 -07:00
Love Hornquist Astrand
0879b9831a
remove trailing whitespace
2011-05-21 11:57:31 -07:00
Love Hornquist Astrand
f5f9014c90
Warning fixes from Christos Zoulas
...
- shadowed variables
- signed/unsigned confusion
- const lossage
- incomplete structure initializations
- unused code
2011-04-29 20:25:05 -07:00
Love Hornquist Astrand
48ad3e1e65
add import/export type for private keys
2010-10-03 16:32:01 -07:00
Love Hornquist Astrand
ccc6175b53
use hx509_certs_iter_f
2009-11-22 13:57:48 -08:00
Love Hornquist Astrand
ce0293b994
Rename f to ksf in the global function namespace to avoid -Wshadow warning
...
Based on a report from Matthias Dieter Wallnöfer.
2009-10-03 11:33:41 -07:00
Love Hornquist Astrand
5373d3a869
Allow parsing of cert fail unless HX509_CERTS_UNPROTECT_ALL is set.
2009-07-30 10:20:04 +02:00
Love Hörnquist Åstrand
21ceaf518f
clear error string, it makes no sense
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25224 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-25 23:43:57 +00:00
Love Hörnquist Åstrand
1eca860a46
Pass up error code from PEM format parser.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25220 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-25 23:43:11 +00:00
Love Hörnquist Åstrand
49e51e45d6
handle pkcs8 PrivateKeyInfo
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25124 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-16 08:24:23 +00:00
Love Hörnquist Åstrand
ff5dab4f4a
remove rcsid
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24795 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-02-22 23:28:18 +00:00
Love Hörnquist Åstrand
64c33e2655
remove printf
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24679 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-02-11 18:31:43 +00:00
Love Hörnquist Åstrand
0f2af8c10f
more EC bits, now parses the private key
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24661 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-02-09 17:16:32 +00:00
Love Hörnquist Åstrand
82c71ee5db
Make parsing of private key generic, prepare for EC private keys.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24657 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-02-07 15:13:48 +00:00
Love Hörnquist Åstrand
6937d41a02
remove trailing whitespace
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand
e172367898
switch to utf8 encoding of all files
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand
23b92e0f89
close-on-exec
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23459 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-07-27 12:13:31 +00:00
Love Hörnquist Åstrand
f3fb4ac367
close-on-exec
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23456 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-07-27 12:12:32 +00:00
Love Hörnquist Åstrand
b1f885befe
use rk_undumpdata, spelling
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23413 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-07-26 18:34:53 +00:00
Love Hörnquist Åstrand
18be53daa7
Support HX509_CERTS_UNPROTECT_ALL.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22465 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-01-16 14:25:24 +00:00
Love Hörnquist Åstrand
6af92427cb
Add writing DER certificates.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21314 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-25 18:45:07 +00:00
Love Hörnquist Åstrand
fc504fb042
Use PEM encoding/decoding functions.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21308 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-25 18:23:51 +00:00
Love Hörnquist Åstrand
b442dada5d
Use hx509_pem_write.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21306 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-25 17:24:43 +00:00
Love Hörnquist Åstrand
8e9ebe14de
Fail if not finding iv.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21141 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-18 21:30:11 +00:00
Love Hörnquist Åstrand
f622a16e97
Add hx509_cert_init_data and use everywhere
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21085 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-13 06:39:53 +00:00
Love Hörnquist Åstrand
659e1cb47e
Update _hx509_collector_alloc prototype.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20776 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-01 22:02:01 +00:00
Love Hörnquist Åstrand
e993ff978b
(store_func): use hx509_cert_binary
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19911 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-14 23:25:28 +00:00
Love Hörnquist Åstrand
80977a02f6
Factor out private key operation out of the signing, operations, support import, export, and generation of private keys. Add support for writing PEM and PKCS12 files with private keys in them.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19778 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-09 10:52:13 +00:00
Love Hörnquist Åstrand
2c45be2461
Try all formats on the binary file before giving up, this way we can
...
handle binary rsa keys too.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19665 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-04 02:01:41 +00:00
Love Hörnquist Åstrand
1f4452b34e
(try_decrypt): pass down AlgorithmIdentifier that key uses to do sigatures
...
so there is no need to hardcode RSA into this function.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19299 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-09 12:13:21 +00:00
Love Hörnquist Åstrand
c2633ac58b
Pass filename to the parse functions and use it in the error messages
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19296 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-08 02:35:19 +00:00
Love Hörnquist Åstrand
3d552d8a43
Return less EINVAL.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18866 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-24 14:08:32 +00:00
Love Hörnquist Åstrand
ff31485ed0
Sprinkle more hx509_context so we can return propper errors.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18863 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-24 13:48:18 +00:00
Love Hörnquist Åstrand
ec923266e2
set ret, remember to free ivdata
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18499 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-17 04:00:14 +00:00
Love Hörnquist Åstrand
1a196d0776
(parse_rsa_private_key): try all password and prompter.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18404 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-11 20:28:49 +00:00
Love Hörnquist Åstrand
00b40cc9a8
(parse_rsa_private_key): free type earlier.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18263 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-06 13:16:07 +00:00
Love Hörnquist Åstrand
556a53109c
(parse_rsa_private_key): free type after use
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18261 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-06 12:08:20 +00:00
Love Hörnquist Åstrand
39ca3ae4a5
Sprinkle error messages.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18052 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-09-07 10:58:17 +00:00
Love Hörnquist Åstrand
b00495b53b
Avoid shadowing.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17575 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-13 20:37:47 +00:00
Love Hörnquist Åstrand
2f50d37991
(file_init): Avoid shadowing ret (and thus avoiding crashing).
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17532 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-11 11:22:50 +00:00
Love Hörnquist Åstrand
74a41b918b
Sprinkel setting error strings.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17391 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-01 14:02:50 +00:00
Love Hörnquist Åstrand
67e0d93a8a
(file_init): reset length when done with a part
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17146 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-21 21:13:49 +00:00
Love Hörnquist Åstrand
01c7345f08
Remove (commented out) debug printf
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17138 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-21 15:03:07 +00:00
Love Hörnquist Åstrand
f4e2e10360
(parse_rsa_private_key): use EVP_get_cipherbyname
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17135 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-21 15:00:10 +00:00
Love Hörnquist Åstrand
1cb767da13
(parse_rsa_private_key): make working for one password.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17134 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-21 14:35:08 +00:00
Love Hörnquist Åstrand
95b95b5581
(parse_rsa_private_key): Implement enought for testing.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17133 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-21 13:26:11 +00:00
Love Hörnquist Åstrand
5b6f397c2d
Add glue code for PEM encrypted password files.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17128 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-21 12:45:53 +00:00