From acadd61a000d7b9d53e0c9506904095963d0b590 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sun, 8 Jul 2007 17:34:24 +0000 Subject: [PATCH] updates. --- CHANGES.RUNTIME | 37 ++++++++++++++++++++++++- TODO | 68 ++++------------------------------------------ includes/silc.h.in | 4 ++- 3 files changed, 45 insertions(+), 64 deletions(-) diff --git a/CHANGES.RUNTIME b/CHANGES.RUNTIME index 56734857..55a723dc 100644 --- a/CHANGES.RUNTIME +++ b/CHANGES.RUNTIME @@ -1,3 +1,38 @@ +Sun Jul 8 20:20:22 EEST 2007 Pekka Riikonen + + * Moved Base64 routines to lib/silcutil/silcbase64.[ch]. Added + SilcStack support to the API. + + * Added allocation support from given stack with SILC_ASN1_ALLOC + flag. Added support for detecting if SILC_ASN1_NULL is present + with SILC_ASN1_OPTIONAL flag. Added support for getting th + choice index with SILC_ASN1_CHOICE. Affected files are + lib/silcasn1/silcasn1.h, silcasn1_encode.c and silcasn1_decode.c. + + * Crypto library changes. + + Rewrote and redesigned crypto library initialization. Added + silc_crypto_init and silc_crypto_uninit. + + Added SilcPKCSObject and SilcPKSCAlgorithm contexts to all + SilcPKCSObject operation callbacks and SilcPKCSAlgorithm + operation callbacks, respectively, as argument. + + Changed silc_pkcs_encrypt, silc_pkcs_decrypt, silc_pkcs_sign + and silc_pkcs_verify APIs asynchronous. They take callback + functions now. Added same callbacks to all SilcPKCSObject + and SilcPKCSAlgorithm operation callbacks. + + * Inherit the lock from parent in SilcStack child. If child + doesn't find stack blocks, check from parent. Added + silc_stack_purge. Affected file is lib/silcutil/silcstack.c. + + * Changed message payload encoding async, due to the PKCS API + changes. Affected files are lib/silccore/silcmessage.[ch]. + + * Added new PKCS API support for connauth and SKE. Affected + files are lib/silcske/silconnauth.c and silcske.c. + Wed Jul 4 20:20:05 EEST 2007 Pekka Riikonen * Unified the SILC_STR_FUNC callback. Affected files are @@ -37,7 +72,7 @@ Tue Jul 3 18:17:54 EEST 2007 Pekka Riikonen also test program lib/silcutil/tests/test_silcdll.c. * Added SILC Environment manipulation API to - lib/silcutil/silcenv.[ch] and test program to + lib/silcutil/silcenv.[ch] and test program to lib/silcutil/tests/test_silcenv.c. * Renamed silc_hash_table_replace to silc_hash_table_set. diff --git a/TODO b/TODO index 7ab7b9ad..a8144872 100644 --- a/TODO +++ b/TODO @@ -290,18 +290,12 @@ Crypto Library, lib/silccrypt/ ============================== o Add silc_crypto_init and silc_crypto_uninit. The _init should take - SilcStack that will act as global memory pool for all of crypto + SilcStack that will act as global memory pool for all of crypto library. It should not be necessary anymore to separately register default ciphers, HMACs, etc, the _init would do that. However, if user after _init calls silc_pkcs_register, for example, it would take preference over the default once, ie. user can always dictate the - order of algorithms. - - The global SilcStack should be used by all routines in lib/silccrypt, - lib/silcacc (and lib/silcmath). lib/silcskr and lib/silcasn1 has support - in the API for providing SilcStack, however, if not provided, they - should look for global SilcStack, if SILC_DIST_CRYPTO is defined. - Same SILC_DIST_CRYPTO ifdef for other libs. + order of algorithms. (***DONE) o Add fingerprint to SilcSILCPublicKey and retrieval to silcpk.h, and possibly to silcpkcs.h. @@ -315,62 +309,12 @@ Crypto Library, lib/silccrypt/ o Change SILC PKCS API to asynchronous, so that accelerators can be used. All PKCS routines should now take callbacks as argument and they should - be delivered to SilcPKCSObject and SilcPKCSAlgorithm too. - - /* Signature computation callback */ - typedef void (*SilcPKCSSignCb)(SilcBool success, - const unsigned char *signature, - SilcUInt32 signature_len, - void *context); - - /* Signature verification callback */ - typedef void (*SilcPKCSVerifyCb)(SilcBool success, void *context); - - /* Encryption callback */ - typedef void (*SilcPKCSEncryptCb)(SilcBool success, - const unsigned char *encrypted, - SilcUInt32 encrypted_len, - void *context); - - /* Decryption callback */ - typedef void (*SilcPKCSDecryptCb)(SilcBool success, - const unsigned char *decrypted, - SilcUInt32 decrypted_len, - void *context); - - Either add new _async functions or add the callbacks to existing API - and if the callback is NULL then the API is not async and if provided - it may be async. For example; - - SilcBool silc_pkcs_sign(SilcPrivateKey private_key, - unsigned char *src, SilcUInt32 src_len, - unsigned char *dst, SilcUInt32 dst_size, - SilcUInt32 *dst_len, - SilcBool compute_hash, SilcHash hash, - SilcPKCSSignCb async_sign, - void *async_sign_context); - - (if this is done then there's no reason why the buffers in the - callbacks cannot be the ones user gives here) or allow only async: - - SilcBool silc_pkcs_sign(SilcPrivateKey private_key, - unsigned char *src, SilcUInt32 src_len, - SilcBool compute_hash, SilcHash hash, - SilcPKCSSignCb async_sign, - void *async_sign_context); - - or add new: - - SilcBool silc_pkcs_sign_async(SilcPrivateKey private_key, - unsigned char *src, SilcUInt32 src_len, - SilcBool compute_hash, SilcHash hash, - SilcPKCSSignCb async_sign, - void *async_sign_context); + be delivered to SilcPKCSObject and SilcPKCSAlgorithm too. (***DONE) o Change PKCS Algorithm API to take SilcPKCSAlgorithm as argument to encrypt, decrypt, sign and verify functions. We may need to for exmaple check the alg->hash, supported hash functions. Maybe deliver it also - to all other functions in SilcPKCSAlgorithm to be consistent. + to all other functions in SilcPKCSAlgorithm to be consistent. (***DONE) o Add DSS support. Take implementation from Tom or make it yourself. @@ -521,11 +465,11 @@ lib/silcasn1 o SILC_ASN1_CHOICE should perhaps return an index what choice in the choice list was found. Currently it is left for caller to figure out - which choice was found. + which choice was found. (***DONE) o SILC_ASN1_NULL in decoding should return SilcBool whether or not the NULL was present. It's important when it's SILC_ASN1_OPTIONAL - and we need to know whether it was present or not. + and we need to know whether it was present or not. (***DONE) lib/silcpgp diff --git a/includes/silc.h.in b/includes/silc.h.in index b758c50a..5c63c403 100644 --- a/includes/silc.h.in +++ b/includes/silc.h.in @@ -237,8 +237,10 @@ extern "C" { #include "silclog.h" #include "silcbuffer.h" #include "silcbuffmt.h" +#include "silcasync.h" /* Crypto library includes */ +#include "silccrypto.h" #include "silccipher.h" #include "silchash.h" #include "silchmac.h" @@ -252,10 +254,10 @@ extern "C" { #include "silcdll.h" #include "silchashtable.h" #include "silcdlist.h" -#include "silcasync.h" #include "silcstream.h" #include "silcnet.h" #include "silcfileutil.h" +#include "silcbase64.h" #include "silcstrutil.h" #include "silcutf8.h" #include "silcstringprep.h" -- 2.24.0