Love Hornquist Astrand
353ac10863
fix use after free
2012-11-27 21:58:04 -08:00
Love Hornquist Astrand
029de6cfa4
pass back an heim_error from hx509_cert_init
2012-10-07 06:33:13 -07:00
Roland C. Dowdeswell
cc47c8fa7b
Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
...
We turn on a few extra warnings and fix the fallout that occurs
when building with --enable-developer. Note that we get different
warnings on different machines and so this will be a work in
progress. So far, we have built on NetBSD/amd64 5.99.64 (which
uses gcc 4.5.3) and Ubuntu 10.04.3 LTS (which uses gcc 4.4.3).
Notably, we fixed
1. a lot of missing structure initialisers,
2. unchecked return values for functions that glibc
marks as __attribute__((warn-unused-result)),
3. made minor modifications to slc and asn1_compile
which can generate code which generates warnings,
and
4. a few stragglers here and there.
We turned off the extended warnings for many programs in appl/ as
they are nearing the end of their useful lifetime, e.g. rsh, rcp,
popper, ftp and telnet.
Interestingly, glibc's strncmp() macro needed to be worked around
whereas the function calls did not.
We have not yet tried this on 32 bit platforms, so there will be
a few more warnings when we do.
2012-02-20 19:45:41 +00: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
Asanka Herath
0d09c879f3
Reduce compiler warnings on Windows
2010-08-20 13:04:06 -04:00
Love Hornquist Astrand
2a842e90d3
Drop MD2 support
...
Patch partly from Guillaume Rousse
2010-04-28 22:10:27 +02:00
Love Hörnquist Åstrand
8a5799199b
Use OID variable instead of function.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25238 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-28 01:18:23 +00:00
Love Hörnquist Åstrand
5385679acd
cast size_t to int for "%.*s"
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25184 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-06 19:02:14 +00:00
Love Hörnquist Åstrand
a041ea8906
remove unused return value
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25179 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-06 19:01:15 +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
8d59ecffe5
don't set P11_LOGIN_DONE before we're logged in
...
fixes crash on subsequent logins
From: Guido Günther.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23858 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-22 06:32:15 +00:00
Love Hörnquist Åstrand
f31067f2fc
[PATCH] don't try to clean unset P11_SESSION_IN_USE
...
fixes abort()
From: Guido Günther.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23857 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-22 06:32:11 +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
8b628c715f
catch error from iterate_entries
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23504 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-08-11 10:00:19 +00:00
Love Hörnquist Åstrand
019e45aea2
Use unsigned where appropriate.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22899 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-07 18:52:36 +00:00
Love Hörnquist Åstrand
c72b88116e
make refcount slightly more sane.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22853 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-07 18:49:16 +00:00
Love Hörnquist Åstrand
5fed824f37
its vs it\'s etc. From Bjorn Sandell
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22071 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-11-14 20:04:50 +00:00
Love Hörnquist Åstrand
1b2bb27066
Add sha2 types.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21387 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-28 08:53:45 +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
0800216d7b
Prefix rsa method with p11_
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20920 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-05 05:47:06 +00:00
Love Hörnquist Åstrand
afbe259df2
Update _hx509_collector_alloc prototype.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20774 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-01 22:00:08 +00:00
Love Hörnquist Åstrand
7971b73f40
add more mechtypes
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20672 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-05-13 06:57:21 +00:00
Love Hörnquist Åstrand
401751b73d
Add some more hashes.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20641 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-05-10 17:59:25 +00:00
Love Hörnquist Åstrand
82a45c7036
constify
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19839 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-11 09:55:09 +00:00
Love Hörnquist Åstrand
a905f0338c
(collect_private_key): Missing CKA_MODULUS is ok too (XXX why should
...
these be fetched given they are not used).
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19790 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-09 19:43:35 +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
3928ceb728
Headerfile <pkcs11.h> is now freestanding, remove pkcs11u.h.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19721 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-01-05 15:32:05 +00:00
Love Hörnquist Åstrand
59238c7f99
Remember to p11_put_session in the failure cases too.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19305 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-11 18:42:42 +00:00
Love Hörnquist Åstrand
fa270376d8
Pass in hx509_signature_rsa to key collector
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19300 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-09 12:18:09 +00:00
Love Hörnquist Åstrand
77e4ca555d
Return less EINVAL.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18876 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-24 19:57:16 +00:00
Love Hörnquist Åstrand
7f316a5b1e
Sprinkle more hx509_context so we can return propper errors.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18860 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-24 13:21:17 +00:00
Love Hörnquist Åstrand
f8bf18b7cc
(p11_list_keys): make element of search_data[0] constants and set them later
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18591 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-19 11:02:01 +00:00
Love Hörnquist Åstrand
ead04d2e0e
Remember to release certs.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18472 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-16 09:50:49 +00:00
Love Hörnquist Åstrand
42ed1a9b6e
(p11_release_module): j needs to be used as inter loop index. From
...
Douglas Engert.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18406 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-11 21:14:14 +00:00
Love Hörnquist Åstrand
e22334b717
Return HX509_PKCS11_NO_SLOT when there are no slots and
...
HX509_PKCS11_NO_TOKEN when there are no token. For use in PAM modules
that want to detect when to use smartcard login and when not
to. Patched based on code from Douglas Engert.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18348 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-08 13:40:46 +00:00
Love Hörnquist Åstrand
dce4b55512
Fix double free's, NULL ptr de-reference, and conform better to pkcs11.
...
From Douglas Engert.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18187 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-01 18:05:05 +00:00
Love Hörnquist Åstrand
dd04abbea7
cast void * to char * when using it for %s formating in printf.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18059 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-09-08 09:54:01 +00:00
Love Hörnquist Åstrand
2fc4f25c93
Don't build most of the pkcs11 module if there are no dlopen().
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18046 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-09-07 09:07:15 +00:00
Love Hörnquist Åstrand
36d0c4e85a
(p11_list_keys): fetch CKA_LABEL and use it to set the friendlyname
...
for the certificate.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18033 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-09-06 09:26:43 +00:00
Love Hörnquist Åstrand
cf9a110826
keep one session around for the whole life of the keyset
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18024 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-09-05 20:51:30 +00:00
Love Hörnquist Åstrand
470639dcbb
(p11_get_session): return better error messages
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18016 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-09-05 17:35:38 +00:00
Love Hörnquist Åstrand
776d5a6b2a
Even more pretty printing.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17983 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-09-04 09:29:24 +00:00
Love Hörnquist Åstrand
c2661ea901
add more mechflags
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17981 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-09-04 09:25:49 +00:00
Love Hörnquist Åstrand
dd02f9c6a5
(p11_printinfo): print proper plural s
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17975 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-09-04 08:30:08 +00:00
Love Hörnquist Åstrand
efd8f3e585
(p11_printinfo): print mechs in diffrent order
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17974 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-09-04 08:26:37 +00:00
Love Hörnquist Åstrand
a16e48e582
save the mechs supported when initing the token, print them in printinfo.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17972 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-09-04 08:23:40 +00:00
Love Hörnquist Åstrand
a99e6303d5
Iterate over all slots, not just the first/selected one.
...
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17591 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-05-29 09:24:47 +00:00