From: Pekka Riikonen Date: Sat, 21 Jul 2007 13:01:16 +0000 (+0000) Subject: PKCS API changes. X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=664b22d58794a76de354831dc44c9ad14e91e389 PKCS API changes. --- diff --git a/apps/irssi/src/silc/core/client_ops.c b/apps/irssi/src/silc/core/client_ops.c index 25afdb04..10454953 100644 --- a/apps/irssi/src/silc/core/client_ops.c +++ b/apps/irssi/src/silc/core/client_ops.c @@ -191,7 +191,7 @@ static void silc_parse_channel_public_keys(SILC_SERVER_REC *server, fingerprint = silc_hash_fingerprint(NULL, pk, pk_len); babbleprint = silc_hash_babbleprint(NULL, pk, pk_len); - silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, pubkey); + silc_pubkey = silc_pkcs_public_key_get_pkcs(SILC_PKCS_SILC, pubkey); printformat_module("fe-common/silc", server, NULL, MSGLEVEL_CRAP, SILCTXT_CHANNEL_PK_LIST_ENTRY, @@ -299,7 +299,7 @@ int verify_message_signature(SilcClientEntry sender, SilcPublicKey cached_pk=NULL; /* try to load the file */ - if (!silc_pkcs_load_public_key(filename, &cached_pk)) { + if (!silc_pkcs_load_public_key(filename, SILC_PKCS_ANY, &cached_pk)) { printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP, SILCTXT_PUBKEY_COULD_NOT_LOAD, "client"); if (pk == NULL) @@ -1427,7 +1427,7 @@ void silc_getkey_cb(bool success, void *context) ((SilcServerEntry)getkey->entry)->public_key); SilcSILCPublicKey silc_pubkey; - silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, public_key); + silc_pubkey = silc_pkcs_public_key_get_pkcs(SILC_PKCS_SILC, public_key); if (success) { if (getkey->id_type == SILC_ID_CLIENT) @@ -2450,7 +2450,7 @@ silc_verify_public_key_internal(SilcClient client, SilcClientConnection conn, return; } - silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, public_key); + silc_pubkey = silc_pkcs_public_key_get_pkcs(SILC_PKCS_SILC, public_key); pw = getpwuid(getuid()); if (!pw) { @@ -2554,8 +2554,9 @@ silc_verify_public_key_internal(SilcClient client, SilcClientConnection conn, SilcUInt32 encpk_len; /* Load the key file, try for both IP filename and hostname filename */ - if (!silc_pkcs_load_public_key(ipf, &local_pubkey) && - (!hostf || (!silc_pkcs_load_public_key(hostf, &local_pubkey)))) { + if (!silc_pkcs_load_public_key(ipf, SILC_PKCS_ANY, &local_pubkey) && + (!hostf || (!silc_pkcs_load_public_key(hostf, SILC_PKCS_ANY, + &local_pubkey)))) { printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP, SILCTXT_PUBKEY_RECEIVED,verify->entity_name ? verify->entity_name : entity); diff --git a/apps/irssi/src/silc/core/clientutil.c b/apps/irssi/src/silc/core/clientutil.c index 83634733..c1632fea 100644 --- a/apps/irssi/src/silc/core/clientutil.c +++ b/apps/irssi/src/silc/core/clientutil.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 1997 - 2006 Pekka Riikonen + Copyright (C) 1997 - 2007 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -66,7 +66,7 @@ void silc_client_print_list(char *list) void silc_client_list_ciphers() { - char *ciphers = silc_cipher_get_supported(); + char *ciphers = silc_cipher_get_supported(FALSE); #ifdef SILC_PLUGIN printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP, SILCTXT_CONFIG_ALGOS, diff --git a/apps/irssi/src/silc/core/silc-channels.c b/apps/irssi/src/silc/core/silc-channels.c index 8917fc2c..4bd4e49e 100644 --- a/apps/irssi/src/silc/core/silc-channels.c +++ b/apps/irssi/src/silc/core/silc-channels.c @@ -1074,7 +1074,8 @@ void silc_list_key(const char *pub_filename, int verbose) SilcUInt32 key_len = 0; int is_server_key = (strstr(pub_filename, "serverkeys") != NULL); - if (!silc_pkcs_load_public_key((char *)pub_filename, &public_key)) { + if (!silc_pkcs_load_public_key((char *)pub_filename, SILC_PKCS_ANY, + &public_key)) { printformat_module("fe-common/silc", NULL, NULL, MSGLEVEL_CRAP, SILCTXT_LISTKEY_LOADPUB, pub_filename); @@ -1089,7 +1090,7 @@ void silc_list_key(const char *pub_filename, int verbose) return; } - silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, public_key); + silc_pubkey = silc_pkcs_public_key_get_pkcs(SILC_PKCS_SILC, public_key); ident = &silc_pubkey->identifier; pk = silc_pkcs_public_key_encode(NULL, public_key, &pk_len); diff --git a/apps/irssi/src/silc/core/silc-queries.c b/apps/irssi/src/silc/core/silc-queries.c index 664eece6..e67b666e 100644 --- a/apps/irssi/src/silc/core/silc-queries.c +++ b/apps/irssi/src/silc/core/silc-queries.c @@ -854,6 +854,7 @@ void silc_query_attributes_print(SILC_SERVER_REC *server, if (verifyd) silc_pkcs_verify(verify->public_key, usersign.data, usersign.data_len, verifyd, verify_len, sha1hash, + silc_client->rng, silc_query_attributes_verify, &verified); if (verified) { @@ -898,6 +899,7 @@ void silc_query_attributes_print(SILC_SERVER_REC *server, if (verifyd) silc_pkcs_verify(public_key, serversign.data, serversign.data_len, verifyd, verify_len, sha1hash, + silc_client->rng, silc_query_attributes_verify, &verified); if (verified) { printformat_module("fe-common/silc", server, NULL, diff --git a/lib/Makefile.ad b/lib/Makefile.ad index 7cb3241c..79473f73 100644 --- a/lib/Makefile.ad +++ b/lib/Makefile.ad @@ -51,6 +51,9 @@ SILCLIB_DIRS = \ #ifdef SILC_DIST_ACC silcacc \ #endif SILC_DIST_ACC +#ifdef SILC_DIST_SSH + silcssh \ +#endif SILC_DIST_SSH if SILC_ENABLE_SHARED LIBTOOL_OPTS= -release $(LIB_BASE_VERSION) -rpath $(DESTDIR)$(libdir) diff --git a/lib/configure.ad b/lib/configure.ad index 426eddb7..fefae05b 100644 --- a/lib/configure.ad +++ b/lib/configure.ad @@ -62,6 +62,12 @@ SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcvcard" #ifdef SILC_DIST_ACC SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcacc" #endif SILC_DIST_ACC +#ifdef SILC_DIST_PGP +SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcpgp" +#endif SILC_DIST_PGP +#ifdef SILC_DIST_SSH +SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcssh" +#endif SILC_DIST_SSH ## ## Library versioning. @@ -320,6 +326,24 @@ lib/silcacc/tests/Makefile ) #endif SILC_DIST_ACC +#ifdef SILC_DIST_PGP +AC_CONFIG_FILES( +lib/silcpgp/Makefile +#ifdef SILC_DIST_INPLACE +lib/silcpgp/tests/Makefile +#endif SILC_DIST_INPLACE +) +#endif SILC_DIST_PGP + +#ifdef SILC_DIST_SSH +AC_CONFIG_FILES( +lib/silcssh/Makefile +#ifdef SILC_DIST_INPLACE +lib/silcssh/tests/Makefile +#endif SILC_DIST_INPLACE +) +#endif SILC_DIST_SSH + fi # compile_libs #endif SILC_DIST_LIB diff --git a/lib/silcacc/DIRECTORY b/lib/silcacc/DIRECTORY new file mode 100644 index 00000000..5c038c71 --- /dev/null +++ b/lib/silcacc/DIRECTORY @@ -0,0 +1,19 @@ + + +SILC Accelerator Library +
+Directory: lib/silcacc/ +
+Library: libsilc.a, libsilc.lib +

+Introduction + +

+SILC Accelerator Library + +

+@LINKS@ diff --git a/lib/silcacc/silcacc_pkcs.c b/lib/silcacc/silcacc_pkcs.c index 03395afc..d1b85e32 100644 --- a/lib/silcacc/silcacc_pkcs.c +++ b/lib/silcacc/silcacc_pkcs.c @@ -242,7 +242,7 @@ SILC_PKCS_SIGN(silc_acc_pkcs_sign) /* Accelerate */ return prv->acc->pkcs[prv->pkcs_index].sign( &prv->acc->pkcs[prv->pkcs_index], prv->context, src, - src_len, compute_hash, hash, sign_cb, context); + src_len, compute_hash, hash, rng, sign_cb, context); } SILC_PKCS_VERIFY(silc_acc_pkcs_verify) @@ -252,7 +252,7 @@ SILC_PKCS_VERIFY(silc_acc_pkcs_verify) /* Accelerate */ return pub->acc->pkcs[pub->pkcs_index].verify( &pub->acc->pkcs[pub->pkcs_index], pub->context, - signature, signature_len, data, data_len, hash, + signature, signature_len, data, data_len, hash, rng, verify_cb, context); } @@ -330,8 +330,8 @@ SilcPublicKey silc_acc_public_key(SilcAccelerator acc, acc_pubkey->pkcs_index = i; /* Accelerate the public key. Returns accelerator context. */ - if (!acc->pkcs->import_public_key(&acc->pkcs[i], public_key, 0, - &acc_pubkey->context)) { + if (!acc->pkcs[i].import_public_key(&acc->pkcs[i], public_key, 0, + &acc_pubkey->context)) { SILC_LOG_ERROR(("Error accelerating public key with accelerator '%s'", acc->name)); silc_free(acc_pubkey); @@ -418,8 +418,8 @@ SilcPrivateKey silc_acc_private_key(SilcAccelerator acc, acc_privkey->pkcs_index = i; /* Accelerate the public key. Returns accelerator context. */ - if (!acc->pkcs->import_private_key(&acc->pkcs[i], private_key, 0, - &acc_privkey->context)) { + if (!acc->pkcs[i].import_private_key(&acc->pkcs[i], private_key, 0, + &acc_privkey->context)) { SILC_LOG_ERROR(("Error accelerating private key with accelerator '%s'", acc->name)); silc_free(acc_privkey); diff --git a/lib/silcacc/softacc.c b/lib/silcacc/softacc.c index 4f5b3fe0..af3a1a2b 100644 --- a/lib/silcacc/softacc.c +++ b/lib/silcacc/softacc.c @@ -294,12 +294,12 @@ void silc_softacc_thread(SilcSchedule schedule, void *context) case SILC_SOFTACC_SIGN: silc_pkcs_sign(e->key.private_key, e->src, e->src_len, e->compute_hash, - e->hash, silc_softacc_data_cb, e); + e->hash, e->rng, silc_softacc_data_cb, e); break; case SILC_SOFTACC_VERIFY: silc_pkcs_verify(e->key.public_key, e->src, e->src_len, e->data, - e->data_len, e->hash, silc_softacc_verify_cb, e); + e->data_len, e->hash, e->rng, silc_softacc_verify_cb, e); break; } } diff --git a/lib/silcapputil/silcapputil.c b/lib/silcapputil/silcapputil.c index be32de6a..abd82dc3 100644 --- a/lib/silcapputil/silcapputil.c +++ b/lib/silcapputil/silcapputil.c @@ -257,7 +257,8 @@ SilcBool silc_load_key_pair(const char *pub_filename, SILC_LOG_DEBUG(("Loading public and private keys")); - if (!silc_pkcs_load_public_key(pub_filename, return_public_key)) { + if (!silc_pkcs_load_public_key(pub_filename, + SILC_PKCS_ANY, return_public_key)) { if (pass) memset(pass, 0, strlen(pass)); silc_free(pass); @@ -272,6 +273,7 @@ SilcBool silc_load_key_pair(const char *pub_filename, if (!silc_pkcs_load_private_key(prv_filename, (const unsigned char *)pass, strlen(pass), + SILC_PKCS_ANY, return_private_key)) { silc_pkcs_public_key_free(*return_public_key); *return_public_key = NULL; @@ -296,7 +298,7 @@ SilcBool silc_show_public_key(SilcPublicKey public_key) SilcUInt32 pk_len; SilcUInt32 key_len = 0; - silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, public_key); + silc_pubkey = silc_pkcs_public_key_get_pkcs(SILC_PKCS_SILC, public_key); if (!silc_pubkey) return FALSE; @@ -344,7 +346,8 @@ SilcBool silc_show_public_key_file(const char *pub_filename) SilcPublicKey public_key; SilcBool ret; - if (!silc_pkcs_load_public_key((char *)pub_filename, &public_key)) { + if (!silc_pkcs_load_public_key((char *)pub_filename, + SILC_PKCS_ANY, &public_key)) { fprintf(stderr, "Could not load public key file `%s'\n", pub_filename); return FALSE; } @@ -375,6 +378,7 @@ SilcBool silc_change_private_key_passphrase(const char *prv_filename, if (!silc_pkcs_load_private_key(prv_filename, (const unsigned char *)pass, strlen(pass), + SILC_PKCS_ANY, &private_key)) { memset(pass, 0, strlen(pass)); silc_free(pass); diff --git a/lib/silcasn1/silcasn1.h b/lib/silcasn1/silcasn1.h index 304dd600..b7b63b37 100644 --- a/lib/silcasn1/silcasn1.h +++ b/lib/silcasn1/silcasn1.h @@ -311,7 +311,7 @@ void silc_asn1_uninit(SilcAsn1 asn1); * the `dest' is dynamically allocated and caller must free it by itself. * If the `stack' was given to silc_asn1_alloc, the SILC_ASN1_ALLOC will * allocate from that stack and consume the stack. Alternatively if - * SILC_ASN1_ACCUMUL is given then memory is accumulated from `asn1' fo + * SILC_ASN1_ACCUMUL is given then memory is accumulated from `asn1' for * `dest' and it is freed only when silc_asn1_free or silc_asn1_uninit * is called. Next call to silc_asn1_encode will not cancel the previous * result, but will accumulate more memory for new result. diff --git a/lib/silcclient/client_attrs.c b/lib/silcclient/client_attrs.c index 4831ed31..b7d0dbde 100644 --- a/lib/silcclient/client_attrs.c +++ b/lib/silcclient/client_attrs.c @@ -172,7 +172,7 @@ void silc_client_attributes_process(SilcClient client, /* Finally compute the digital signature of all the data we provided. */ silc_pkcs_sign(conn->private_key, silc_buffer_data(buffer), silc_buffer_len(buffer), TRUE, conn->internal->sha1hash, - silc_client_attributes_process_signed, s); + client->rng, silc_client_attributes_process_signed, s); } static void silc_client_attribute_destruct(void *key, void *context, diff --git a/lib/silcclient/command.c b/lib/silcclient/command.c index d3220d54..abc94ef8 100644 --- a/lib/silcclient/command.c +++ b/lib/silcclient/command.c @@ -696,7 +696,7 @@ SILC_FSM_STATE(silc_client_command_whois) SilcAttributeObjPk obj; SilcPublicKey pk; - if (!silc_pkcs_load_public_key(pubkey, &pk)) { + if (!silc_pkcs_load_public_key(pubkey, SILC_PKCS_ANY, &pk)) { SAY(client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR, "Could not load public key %s, check the filename", pubkey); @@ -1071,7 +1071,7 @@ SILC_FSM_STATE(silc_client_command_invite) action[0] = 0x01; /* Check if it is public key file to be added to invite list */ - silc_pkcs_load_public_key(cmd->argv[2] + 1, &pubkey); + silc_pkcs_load_public_key(cmd->argv[2] + 1, SILC_PKCS_ANY, &pubkey); invite = cmd->argv[2]; if (!pubkey) invite++; @@ -1501,6 +1501,7 @@ SILC_FSM_STATE(silc_client_command_join) pubkey, privkey, pubdata, sizeof(pubdata), conn->internal->sha1hash, + client->rng, conn->local_id, SILC_ID_CLIENT, silc_client_command_join_signed, @@ -1989,7 +1990,8 @@ SILC_FSM_STATE(silc_client_command_cmode) for (k = 3; k < cmd->argc; k++) { if (cmd->argv[k][0] == '+') chadd = TRUE; - if (!silc_pkcs_load_public_key(cmd->argv[k] + 1, &chpk)) { + if (!silc_pkcs_load_public_key(cmd->argv[k] + 1, SILC_PKCS_ANY, + &chpk)) { SAY(conn->client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR, "Could not load public key %s, check the filename", cmd->argv[k]); @@ -2564,7 +2566,7 @@ SILC_FSM_STATE(silc_client_command_ban) action[0] = 0x01; /* Check if it is public key file to be added to invite list */ - silc_pkcs_load_public_key(cmd->argv[2] + 1, &pubkey); + silc_pkcs_load_public_key(cmd->argv[2] + 1, SILC_PKCS_ANY, &pubkey); ban = cmd->argv[2]; if (!pubkey) ban++; @@ -2664,7 +2666,7 @@ SILC_FSM_STATE(silc_client_command_watch) SilcPublicKey pk; SilcBuffer buffer; - if (!silc_pkcs_load_public_key(pubkey, &pk)) { + if (!silc_pkcs_load_public_key(pubkey, SILC_PKCS_ANY, &pk)) { SAY(conn->client, conn, SILC_CLIENT_MESSAGE_COMMAND_ERROR, "Could not load public key %s, check the filename", pubkey); COMMAND_ERROR(SILC_STATUS_ERR_NOT_ENOUGH_PARAMS); diff --git a/lib/silccore/silcauth.c b/lib/silccore/silcauth.c index 5082162e..d14899d3 100644 --- a/lib/silccore/silcauth.c +++ b/lib/silccore/silcauth.c @@ -312,7 +312,7 @@ silc_auth_public_key_auth_generate(SilcPublicKey public_key, return silc_auth_public_key_auth_generate_wpub(public_key, private_key, randomdata, sizeof(randomdata), - hash, id, type, generated, + hash, rng, id, type, generated, context); } @@ -326,6 +326,7 @@ silc_auth_public_key_auth_generate_wpub(SilcPublicKey public_key, const unsigned char *pubdata, SilcUInt32 pubdata_len, SilcHash hash, + SilcRng rng, const void *id, SilcIdType type, SilcAuthGenerated generated, void *context) @@ -369,7 +370,7 @@ silc_auth_public_key_auth_generate_wpub(SilcPublicKey public_key, } /* Compute the hash and the signature. */ - op = silc_pkcs_sign(private_key, tmp, tmp_len, TRUE, hash, + op = silc_pkcs_sign(private_key, tmp, tmp_len, TRUE, hash, rng, silc_auth_public_key_auth_generate_cb, a); memset(tmp, 0, tmp_len); @@ -408,7 +409,7 @@ silc_auth_public_key_auth_verify(SilcAuthPayload payload, /* Verify the authentication data */ op = silc_pkcs_verify(public_key, payload->auth_data, - payload->auth_len, tmp, tmp_len, hash, + payload->auth_len, tmp, tmp_len, hash, NULL, result, context); memset(tmp, 0, tmp_len); diff --git a/lib/silccore/silcauth.h b/lib/silccore/silcauth.h index 438c461c..5a61c9b3 100644 --- a/lib/silccore/silcauth.h +++ b/lib/silccore/silcauth.h @@ -267,6 +267,7 @@ silc_auth_public_key_auth_generate(SilcPublicKey public_key, * const unsigned char *pubdata, * SilcUInt32 pubdata_len, * SilcHash hash, + * SilcRng rng, * const void *id, * SilcIdType type, * SilcAuthGenerated generated, @@ -289,6 +290,7 @@ silc_auth_public_key_auth_generate_wpub(SilcPublicKey public_key, const unsigned char *pubdata, SilcUInt32 pubdata_len, SilcHash hash, + SilcRng rng, const void *id, SilcIdType type, SilcAuthGenerated generated, void *context); diff --git a/lib/silccore/silcmessage.c b/lib/silccore/silcmessage.c index a308456b..2b817ba7 100644 --- a/lib/silccore/silcmessage.c +++ b/lib/silccore/silcmessage.c @@ -44,6 +44,7 @@ typedef struct { SilcMessageFlags flags; SilcPublicKey public_key; SilcPrivateKey private_key; + SilcRng rng; SilcHash hash; SilcCipher cipher; SilcHmac hmac; @@ -292,6 +293,7 @@ silc_message_signed_payload_encode(SilcBuffer payload, SilcUInt32 pk_len = 0; SilcUInt16 pk_type; SilcStack stack = e->stack; + SilcRng rng = e->rng; SilcHash hash = e->hash; SilcPublicKey public_key = e->public_key; SilcPrivateKey private_key = e->private_key; @@ -334,7 +336,8 @@ silc_message_signed_payload_encode(SilcBuffer payload, /* Compute signature */ op = silc_pkcs_sign(private_key, sign->data, silc_buffer_len(sign), - TRUE, hash, silc_message_signed_payload_encode_cb, e); + TRUE, hash, rng, + silc_message_signed_payload_encode_cb, e); return op; } @@ -762,6 +765,7 @@ silc_message_payload_encode(SilcMessageFlags flags, e->flags = flags; e->public_key = public_key; e->private_key = private_key; + e->rng = rng; e->hash = hash; e->cipher = cipher; e->hmac = hmac; @@ -873,8 +877,8 @@ silc_message_signed_verify(SilcMessagePayload message, /* Verify the authentication data */ op = silc_pkcs_verify(remote_public_key, sig->sign_data, sig->sign_len, - silc_buffer_data(sign), silc_buffer_len(sign), hash, - result, context); + silc_buffer_data(sign), silc_buffer_len(sign), + hash, NULL, result, context); silc_buffer_clear(sign); silc_buffer_sfree(stack, sign); diff --git a/lib/silcske/silcconnauth.c b/lib/silcske/silcconnauth.c index 3d50902d..6b43421d 100644 --- a/lib/silcske/silcconnauth.c +++ b/lib/silcske/silcconnauth.c @@ -147,7 +147,7 @@ silc_connauth_get_signature(SilcConnAuth connauth) /* Compute signature */ op = silc_pkcs_sign(private_key, auth->data, silc_buffer_len(auth), - TRUE, ske->prop->hash, + TRUE, ske->prop->hash, ske->rng, silc_connauth_get_signature_cb, connauth); silc_buffer_free(auth); @@ -210,7 +210,7 @@ silc_connauth_verify_signature(SilcConnAuth connauth, /* Verify signature */ op = silc_pkcs_verify(pub_key, sign, sign_len, auth->data, - silc_buffer_len(auth), ske->prop->hash, + silc_buffer_len(auth), ske->prop->hash, ske->rng, silc_connauth_verify_signature_cb, connauth); silc_buffer_free(auth); diff --git a/lib/silcske/silcske.c b/lib/silcske/silcske.c index 8c166490..b0147f22 100644 --- a/lib/silcske/silcske.c +++ b/lib/silcske/silcske.c @@ -863,7 +863,7 @@ silc_ske_assemble_security_properties(SilcSKE ske, rp->pkcs_alg_len = strlen(rp->pkcs_alg_list); /* Get supported encryption algorithms */ - rp->enc_alg_list = silc_cipher_get_supported(); + rp->enc_alg_list = silc_cipher_get_supported(TRUE); rp->enc_alg_len = strlen(rp->enc_alg_list); /* Get supported hash algorithms */ @@ -1507,7 +1507,7 @@ SILC_FSM_STATE(silc_ske_st_initiator_phase2) /* Sign the hash value */ SILC_FSM_CALL(ske->key_op = silc_pkcs_sign(ske->private_key, hash, hash_len, FALSE, - ske->prop->hash, + ske->prop->hash, ske->rng, silc_ske_initiator_sign_cb, ske)); /* NOT REACHED */ } @@ -1717,7 +1717,7 @@ SILC_FSM_STATE(silc_ske_st_initiator_phase4) SILC_FSM_CALL(ske->key_op = silc_pkcs_verify(ske->prop->public_key, payload->sign_data, payload->sign_len, hash, hash_len, NULL, - silc_ske_verify_cb, ske)); + ske->rng, silc_ske_verify_cb, ske)); /* NOT REACHED */ } @@ -2247,7 +2247,7 @@ SILC_FSM_STATE(silc_ske_st_responder_phase4) silc_pkcs_verify(ske->prop->public_key, recv_payload->sign_data, recv_payload->sign_len, - hash, hash_len, NULL, + hash, hash_len, NULL, ske->rng, silc_ske_verify_cb, ske)); /* NOT REACHED */ } @@ -2343,7 +2343,7 @@ SILC_FSM_STATE(silc_ske_st_responder_phase5) /* Sign the hash value */ SILC_FSM_CALL(ske->key_op = silc_pkcs_sign(ske->private_key, hash, hash_len, FALSE, - ske->prop->hash, + ske->prop->hash, ske->rng, silc_ske_responder_sign_cb, ske)); /* NOT REACHED */ } diff --git a/lib/silcskr/silcskr.c b/lib/silcskr/silcskr.c index a3396612..c61ac5fb 100644 --- a/lib/silcskr/silcskr.c +++ b/lib/silcskr/silcskr.c @@ -375,7 +375,7 @@ static SilcSKRStatus silc_skr_add_silc(SilcSKR skr, #endif /* SILC_DEBUG */ /* Get the SILC public key */ - silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, public_key); + silc_pubkey = silc_pkcs_public_key_get_pkcs(SILC_PKCS_SILC, public_key); ident = &silc_pubkey->identifier; SILC_LOG_DEBUG(("Adding SILC public key %p [%s], context %p", @@ -555,7 +555,7 @@ static SilcSKRStatus silc_skr_del_silc_public_key(SilcSKR skr, SilcDList entry; /* Get the SILC public key */ - silc_pubkey = silc_pkcs_get_context(SILC_PKCS_SILC, public_key); + silc_pubkey = silc_pkcs_public_key_get_pkcs(SILC_PKCS_SILC, public_key); ident = &silc_pubkey->identifier; SILC_LOG_DEBUG(("Deleting SILC public key [%s]", ident->username));