From ce584c39a3f9729c2647446326e0ce24489873dc Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Tue, 5 Mar 2002 12:29:43 +0000 Subject: [PATCH] updates --- CHANGES | 7 +++++++ TODO | 28 ++++++++++++++++++++++------ lib/silccrypt/silccipher.c | 4 ++-- lib/silccrypt/silccipher.h | 2 +- lib/silccrypt/silchash.c | 4 ++-- lib/silccrypt/silchash.h | 2 +- lib/silccrypt/silchmac.c | 4 ++-- lib/silccrypt/silchmac.h | 2 +- lib/silccrypt/silcpkcs.c | 4 ++-- lib/silccrypt/silcpkcs.h | 2 +- lib/silcsftp/sftp_fs_memory.c | 7 ++++--- 11 files changed, 45 insertions(+), 21 deletions(-) diff --git a/CHANGES b/CHANGES index 0f8488b6..214a080a 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +Tue Mar 5 14:37:27 EET 2002 Pekka Riikonen + + * Changed all silc_[hash|hmac|cipher|pkcs]_default tables to + constants. Affected files in + lib/silccrypt/silcpkcs.[ch], silchash.[ch], silchmac.[ch] and + silccipher.[ch]. + Sun Mar 3 18:37:13 EET 2002 Pekka Riikonen * Fixed the buffer formatting and unformatting routines to diff --git a/TODO b/TODO index 52f0769d..4af357e6 100644 --- a/TODO +++ b/TODO @@ -100,6 +100,28 @@ TODO/bugs In SILC Libraries context it provides, which is delivered by SFTP libary to all callback functions. + o EPOC specific additions/changes required: + + o lib/silcutil/epoc routines missing or not completed. + + o Rewrite the lib/silcutil/silcprotocol.[ch] not to have + [un]register functions, but to make it context based all the + way. The alloc should take as argument the protocol type and + its callback (not only final callback). It is not good that we + have now global list of registered protocols. + + o Global RNG should not be allowed on EPOC, since it won't + work. Every function in library that calls the global RNG must + also take the RNG context as argument so that application can + provide it if it doesn't want to use global RNG. + + o Think some solution to the global crypto lists in lib/silccrypt. + They won't work on EPOC. + + o Something needs to be thought to the logging globals as well, + like silc_debug etc. They won't work on EPOC. Perhaps logging + and debugging is to be disabled on EPOC. + TODO in Toolkit Documentation ============================= @@ -233,12 +255,6 @@ least could be done. compression thus it must be implemented. SILC Zip API must be defined. - o Rewrite the lib/silcutil/silcprotocol.[ch] not to have [un]register - functions, but to make it context based all the way. The alloc should - take as argument the protocol type and its callback (not only - final callback). It is not good that we have now global list of - registered protocols. - o Optimizations in Libraries o There is currently three (3) allocations per packet in the diff --git a/lib/silccrypt/silccipher.c b/lib/silccrypt/silccipher.c index 35155c51..d07de22a 100644 --- a/lib/silccrypt/silccipher.c +++ b/lib/silccrypt/silccipher.c @@ -27,7 +27,7 @@ SilcDList silc_cipher_list = NULL; /* Static list of ciphers for silc_cipher_register_default(). */ -SilcCipherObject silc_default_ciphers[] = +const SilcCipherObject silc_default_ciphers[] = { { "aes-256-cbc", 16, 256, silc_aes_set_key, silc_aes_set_key_with_string, silc_aes_encrypt_cbc, @@ -162,7 +162,7 @@ bool silc_cipher_register_default(void) int i; for (i = 0; silc_default_ciphers[i].name; i++) - silc_cipher_register(&(silc_default_ciphers[i])); + silc_cipher_register((SilcCipherObject *)&(silc_default_ciphers[i])); return TRUE; } diff --git a/lib/silccrypt/silccipher.h b/lib/silccrypt/silccipher.h index 205adb83..3c1d549a 100644 --- a/lib/silccrypt/silccipher.h +++ b/lib/silccrypt/silccipher.h @@ -74,7 +74,7 @@ typedef struct SilcCipherStruct { #define SILC_ALL_CIPHERS ((SilcCipherObject *)1) /* Static list of ciphers for silc_cipher_register_default(). */ -extern DLLAPI SilcCipherObject silc_default_ciphers[]; +extern DLLAPI const SilcCipherObject silc_default_ciphers[]; /* Default cipher in the SILC protocol */ #define SILC_DEFAULT_CIPHER "aes-256-cbc" diff --git a/lib/silccrypt/silchash.c b/lib/silccrypt/silchash.c index 4bb91087..66a6ab8e 100644 --- a/lib/silccrypt/silchash.c +++ b/lib/silccrypt/silchash.c @@ -28,7 +28,7 @@ SilcDList silc_hash_list = NULL; /* Default hash functions for silc_hash_register_default(). */ -SilcHashObject silc_default_hash[] = +const SilcHashObject silc_default_hash[] = { { "sha1", 20, 64, silc_sha1_init, silc_sha1_update, silc_sha1_final, silc_sha1_transform, silc_sha1_context_len }, @@ -112,7 +112,7 @@ bool silc_hash_register_default(void) int i; for (i = 0; silc_default_hash[i].name; i++) - silc_hash_register(&(silc_default_hash[i])); + silc_hash_register((SilcHashObject *)&(silc_default_hash[i])); return TRUE; } diff --git a/lib/silccrypt/silchash.h b/lib/silccrypt/silchash.h index 8de3e5eb..c5091240 100644 --- a/lib/silccrypt/silchash.h +++ b/lib/silccrypt/silchash.h @@ -49,7 +49,7 @@ typedef struct SilcHashStruct { #define SILC_ALL_HASH_FUNCTIONS ((SilcHashObject *)1) /* Default hash functions for silc_hash_register_default(). */ -extern DLLAPI SilcHashObject silc_default_hash[]; +extern DLLAPI const SilcHashObject silc_default_hash[]; /* Default HASH function in the SILC protocol */ #define SILC_DEFAULT_HASH "sha1" diff --git a/lib/silccrypt/silchmac.c b/lib/silccrypt/silchmac.c index babadd05..4c701305 100644 --- a/lib/silccrypt/silchmac.c +++ b/lib/silccrypt/silchmac.c @@ -38,7 +38,7 @@ struct SilcHmacStruct { SilcDList silc_hmac_list = NULL; /* Default hmacs for silc_hmac_register_default(). */ -SilcHmacObject silc_default_hmacs[] = +const SilcHmacObject silc_default_hmacs[] = { { "hmac-sha1-96", 12 }, { "hmac-md5-96", 12 }, @@ -145,7 +145,7 @@ bool silc_hmac_register_default(void) int i; for (i = 0; silc_default_hmacs[i].name; i++) - silc_hmac_register(&(silc_default_hmacs[i])); + silc_hmac_register((SilcHmacObject *)&(silc_default_hmacs[i])); return TRUE; } diff --git a/lib/silccrypt/silchmac.h b/lib/silccrypt/silchmac.h index 37d28c59..a64b5366 100644 --- a/lib/silccrypt/silchmac.h +++ b/lib/silccrypt/silchmac.h @@ -73,7 +73,7 @@ typedef struct { #define SILC_ALL_HMACS ((SilcHmacObject *)1) /* Default hmacs for silc_hmac_register_default(). */ -extern DLLAPI SilcHmacObject silc_default_hmacs[]; +extern DLLAPI const SilcHmacObject silc_default_hmacs[]; /* Default HMAC in the SILC protocol */ #define SILC_DEFAULT_HMAC "hmac-sha1-96" diff --git a/lib/silccrypt/silcpkcs.c b/lib/silccrypt/silcpkcs.c index 21821257..e1497387 100644 --- a/lib/silccrypt/silcpkcs.c +++ b/lib/silccrypt/silcpkcs.c @@ -28,7 +28,7 @@ SilcDList silc_pkcs_list = NULL; /* Static list of PKCS for silc_pkcs_register_default(). */ -SilcPKCSObject silc_default_pkcs[] = +const SilcPKCSObject silc_default_pkcs[] = { /* RSA with PKCS #1 (Uses directly routines from Raw RSA operations) */ { "rsa", @@ -118,7 +118,7 @@ bool silc_pkcs_register_default(void) int i; for (i = 0; silc_default_pkcs[i].name; i++) - silc_pkcs_register(&(silc_default_pkcs[i])); + silc_pkcs_register((SilcPKCSObject *)&(silc_default_pkcs[i])); return TRUE; } diff --git a/lib/silccrypt/silcpkcs.h b/lib/silccrypt/silcpkcs.h index 97fc45c1..5c1542ce 100644 --- a/lib/silccrypt/silcpkcs.h +++ b/lib/silccrypt/silcpkcs.h @@ -97,7 +97,7 @@ typedef struct { #define SILC_ALL_PKCS ((SilcPKCSObject *)1) /* Static list of PKCS for silc_pkcs_register_default(). */ -extern DLLAPI SilcPKCSObject silc_default_pkcs[]; +extern DLLAPI const SilcPKCSObject silc_default_pkcs[]; /* Default PKXS in the SILC protocol */ #define SILC_DEFAULT_PKCS "rsa" diff --git a/lib/silcsftp/sftp_fs_memory.c b/lib/silcsftp/sftp_fs_memory.c index b60cce73..621fdee7 100644 --- a/lib/silcsftp/sftp_fs_memory.c +++ b/lib/silcsftp/sftp_fs_memory.c @@ -26,7 +26,7 @@ #define DIR_SEPARATOR "/" -struct SilcSFTPFilesystemOpsStruct silc_sftp_fs_memory; +const struct SilcSFTPFilesystemOpsStruct silc_sftp_fs_memory; /* Memory filesystem entry */ typedef struct MemFSEntryStruct { @@ -320,7 +320,8 @@ SilcSFTPFilesystem silc_sftp_fs_memory_alloc(SilcSFTPFSMemoryPerm perm) fs->root->name = strdup(DIR_SEPARATOR); filesystem = silc_calloc(1, sizeof(*filesystem)); - filesystem->fs = &silc_sftp_fs_memory; + filesystem->fs = + (struct SilcSFTPFilesystemOpsStruct *)&silc_sftp_fs_memory; filesystem->fs_context = (void *)fs; return filesystem; @@ -1014,7 +1015,7 @@ void mem_extended(void *context, SilcSFTP sftp, callback_context); } -struct SilcSFTPFilesystemOpsStruct silc_sftp_fs_memory = { +const struct SilcSFTPFilesystemOpsStruct silc_sftp_fs_memory = { mem_get_handle, mem_encode_handle, mem_open, -- 2.24.0