X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcclient%2Fcommand_reply.c;h=67d8f666790a46fb943df753ca549dd93547fe04;hb=cdedc07c65bab8467f6f5b1ef4b38982c2c77571;hp=e1c03f38870fb3c4032c763fb2e32308f81295b2;hpb=2878ba34b8d864f89cfb785448e95cdd42297ee0;p=silc.git diff --git a/lib/silcclient/command_reply.c b/lib/silcclient/command_reply.c index e1c03f38..67d8f666 100644 --- a/lib/silcclient/command_reply.c +++ b/lib/silcclient/command_reply.c @@ -1770,10 +1770,8 @@ SILC_CLIENT_CMD_REPLY_FUNC(getkey) SilcClientEntry client_entry; SilcServerID *server_id = NULL; SilcServerEntry server_entry; - SilcSKEPKType type; - unsigned char *tmp, *pk; + unsigned char *tmp; SilcUInt32 len; - SilcUInt16 pk_len; SilcIdType id_type; SilcPublicKey public_key = NULL; @@ -1800,15 +1798,9 @@ SILC_CLIENT_CMD_REPLY_FUNC(getkey) /* Get the public key payload */ tmp = silc_argument_get_arg_type(cmd->args, 3, &len); if (tmp) { - /* Decode the public key */ - SILC_GET16_MSB(pk_len, tmp); - SILC_GET16_MSB(type, tmp + 2); - pk = tmp + 4; - - if (type == SILC_SKE_PK_TYPE_SILC) - if (!silc_pkcs_public_key_decode(pk, pk_len, &public_key)) - public_key = NULL; - } + if (!silc_pkcs_public_key_payload_decode(tmp, len, &public_key)) + public_key = NULL; + } id_type = silc_id_payload_get_type(idp); if (id_type == SILC_ID_CLIENT) {