Nicolas Williams
cce8ae9927
hx509: Pass PKCS#8 keys to lower layers
...
OpenSSL's d2i_ECPrivateKey() is deprecated, so we have to use
d2i_PrivateKey(), but d2i_PrivateKey() wants the whole PKCS#8 blob so it
can know what kind of key it is. So we need to let the hx509 EC layer
get that blob. The internal APIs need some refactoring, so for now we
use a hack where we try to parse the private key with and without the
PKCS#8 wrapper.
2022-11-22 11:34:54 -05:00
Nicolas Williams
dd71303a2f
hx509: Fix coverity warnings
2022-01-17 17:36:48 -06:00
Jeffrey Altman
1dd38cc3de
lib/hx509: declare and apply HX509_LIB_xxx macros
...
libhx509 is not built according to the same export and calling conventions
on Windows as the other libraries. This change declares and applies
HX509_LIB_FUNCTION, HX509_LIB_NORETURN_FUNCTION, HX509_LIB_CALL and
HX509_LIB_VARIABLE to lib/hx509.
As a result of this change the calling convention for exported functions
will be __stdcall instead of __cdecl.
Change-Id: Ibc3f05e8088030ef7d13798f1d9c9b190bc57797
2019-01-02 10:23:39 -06: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
Jelmer Vernooij
36ade8b509
hx509: Make various functions used by Samba public.
...
* hx509_cert_public_encrypt
* hx509_parse_private_key
* hx509_private_key_assign_rsa
* hx509_private_key_free
* hx509_private_key_private_decrypt
* hx509_private_key_init
* hx509_private_key2SPKI
* hx509_request_get_name
* hx509_request_get_SubjectPublicKeyInfo
* hx509_request_free
* hx509_request_init
* hx509_request_set_name
* hx509_request_set_SubjectPublicKeyInfo
Signed-off-by: Love Hornquist Astrand <lha@h5l.org >
2011-02-23 19:47:28 -08:00
Love Hornquist Astrand
48ad3e1e65
add import/export type for private keys
2010-10-03 16:32:01 -07:00
Love Hörnquist Åstrand
afa607c8f4
pass more bit so that EC keys works
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25219 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-25 23:42:58 +00:00
Love Hörnquist Åstrand
bc8666ab5a
nkeys not used any more, don't increment
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24915 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-03-22 17:22:40 +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
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
4481b27002
(_hx509_collector_alloc): return error code instead of pointer.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20778 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-01 22:04:13 +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
f58f609484
Sprinkle more hx509_context so we can return propper errors.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18861 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-24 13:34:21 +00:00
Love Hörnquist Åstrand
da56224c8e
No more EINVAL.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18856 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-24 12:43:45 +00:00
Love Hörnquist Åstrand
94c6bdf852
indent
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18831 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-22 15:58:33 +00:00
Love Hörnquist Åstrand
96204e40a8
prefix der primitives with der_
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18453 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-14 09:42:43 +00:00
Love Hörnquist Åstrand
7b967d0631
Sprinkle setting error strings.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17407 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-02 10:31:05 +00:00
Love Hörnquist Åstrand
61ab887d2a
handle PEM RSA PRIVATE KEY files
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17122 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-21 11:26:05 +00:00
Love Hörnquist Åstrand
f4e25d6573
(match_localkeyid): no need to add back the cert to the cert pool, its
...
already there.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16840 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-03-27 22:09:28 +00:00
Love Hörnquist Åstrand
6e3958b47e
(_hx509_collector_alloc): handle errors
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16826 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-03-27 04:26:05 +00:00
Love Hörnquist Åstrand
099a14e094
hx509_certs_find is now exposed.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16811 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-03-26 23:49:04 +00:00
Love Hörnquist Åstrand
163c6cb7b5
delete crypto_headers.h, use global file instead
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16560 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-01-13 14:02:49 +00:00
Love Hörnquist Åstrand
4a4b90d3b8
Use "crypto-headers.h".
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16484 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-01-08 21:58:46 +00:00
Love Hörnquist Åstrand
7dcf3289bb
add a hx509_context where we can store configuration
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16476 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-01-04 20:33:31 +00:00
Love Hörnquist Åstrand
d4c217034c
(struct private_key): remove temporary key data storage, convert directly to a key
...
(match_localkeyid): match certificate and key using localkeyid
(match_keys): match certificate and key using _hx509_match_keys
(_hx509_collector_collect): rewrite to use match_keys and match_localkeyid
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16471 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-01-04 14:54:32 +00:00
Love Hörnquist Åstrand
971cfe76fa
Use hx509_private_key to assign private keys.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16456 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-01-04 03:13:49 +00:00
Love Hörnquist Åstrand
d231839e98
Support functions to collect certificates and private keys and then match them.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16446 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-01-03 16:29:25 +00:00