PKCS API changes.
authorPekka Riikonen <priikone@silcnet.org>
Sat, 21 Jul 2007 13:01:16 +0000 (13:01 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 21 Jul 2007 13:01:16 +0000 (13:01 +0000)
19 files changed:
apps/irssi/src/silc/core/client_ops.c
apps/irssi/src/silc/core/clientutil.c
apps/irssi/src/silc/core/silc-channels.c
apps/irssi/src/silc/core/silc-queries.c
lib/Makefile.ad
lib/configure.ad
lib/silcacc/DIRECTORY [new file with mode: 0644]
lib/silcacc/silcacc_pkcs.c
lib/silcacc/softacc.c
lib/silcapputil/silcapputil.c
lib/silcasn1/silcasn1.h
lib/silcclient/client_attrs.c
lib/silcclient/command.c
lib/silccore/silcauth.c
lib/silccore/silcauth.h
lib/silccore/silcmessage.c
lib/silcske/silcconnauth.c
lib/silcske/silcske.c
lib/silcskr/silcskr.c

index 25afdb040150321991474180add62f4e30ef6d08..1045495340929d31e331d1e763fda0e038a93d4d 100644 (file)
@@ -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);
index 836347338a3457deaa8af281f5d37ef4d6775dc1..c1632fea0d621615e278ab289df1c352b81c318c 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  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,
index 8917fc2ced40b8d36966c5754ad0893b89600d3a..4bd4e49ef556fb0d8a464fb930f8f014028eafa7 100644 (file)
@@ -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);
index 664eece66117fdb6cffb98d86b102a625c533fe8..e67b666ef8e0f6a2f1f0a23c3fbd4af2aa6d23e8 100644 (file)
@@ -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,
index 7cb3241c7c62e28b021bd836ee64f88105a72fa6..79473f739e9ba25f51fb969674858278f64117fa 100644 (file)
@@ -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)
index 426eddb73faa06e0b1285313a4771345ba639973..fefae05bbf48b3636ee5fe9082a59e1463db0c51 100644 (file)
@@ -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 (file)
index 0000000..5c038c7
--- /dev/null
@@ -0,0 +1,19 @@
+<!--
+@LIBRARY=SILC Accelerator Library
+@FILENAME=silcacclib.html
+@LINK=silcacc.html:SILC Accelerator Interface
+-->
+
+<big><b>SILC Accelerator Library</b></big>
+<br />
+<small>Directory: lib/silcacc/</small>
+<br />
+<small>Library: libsilc.a, libsilc.lib</small>
+<br /><br />
+<b>Introduction</b>
+
+<br /><br />
+SILC Accelerator Library
+
+<br /><br />
+@LINKS@
index 03395afcca64d4c69498a50d8852347b4465c490..d1b85e327d296d36430947fbf5cfff1313a3e200 100644 (file)
@@ -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);
index 4f5b3fe0ea5adfaedd1eebde91a49d55ddd52e47..af3a1a2be628fbb4b3ebea1253d9b02b372e9745 100644 (file)
@@ -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;
   }
 }
index be32de6aed520f411682daf0e13922a950d19fea..abd82dc30d86c03295ac5778e77cec773d40a24b 100644 (file)
@@ -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);
index 304dd600ed04d5659b783e2864a6b3f8f5a61ad4..b7b63b370f55c54ff6636f8f5a4c997e8c1aec51 100644 (file)
@@ -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.
index 4831ed31daa4d5b946e9ccbaf8d82d5fc544e3a3..b7d0dbde94c14738c6b9bb6ec7ef6424b10dab8d 100644 (file)
@@ -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,
index d3220d54e58d9892d6700d57d54e56b6bf9e5f92..abc94ef873da41bcb5bde3bc0fa31d48435c9ff8 100644 (file)
@@ -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);
index 5082162e75051d35993382aaa4df794b7a947602..d14899d33a12f17ccbf55cacffbec65d3072b2e8 100644 (file)
@@ -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);
index 438c461cee75650958d8b82c2129ef73ea9072bc..5a61c9b3f06bab1c9068491e70ed626807bb816a 100644 (file)
@@ -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);
index a308456be89c85db6a92d5fc3b562549546979a5..2b817ba708c79f8232272163659e0269db427f2e 100644 (file)
@@ -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);
index 3d50902df831a53c2ff527c53d4cf9d22098a0e0..6b43421daa259c1f9dd5adc3de1884f0feda9803 100644 (file)
@@ -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);
index 8c166490d08e9d5748324209783170c962566f26..b0147f22a65ef1c575983578ef3bc33b64341c7c 100644 (file)
@@ -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 */
   }
index a339661230fc2dbf6e0a678508b4995cfeb36cae..c61ac5fbfa51ea50aefcde55cfa0af230306bf12 100644 (file)
@@ -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));