From: Pekka Riikonen Date: Thu, 12 Dec 2002 13:19:30 +0000 (+0000) Subject: Signed messages support X-Git-Tag: silc.client.0.9.11~34 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=01deeaddaefd3312aa71f47827ad4b051d40987c Signed messages support --- diff --git a/tutorial/mybot/mybot.c b/tutorial/mybot/mybot.c index e1c8d216..10163ef8 100644 --- a/tutorial/mybot/mybot.c +++ b/tutorial/mybot/mybot.c @@ -171,7 +171,11 @@ silc_channel_message(SilcClient client, SilcClientConnection conn, SilcUInt32 message_len) { /* Yay! We got a message from channel. */ - fprintf(stdout, "<%s> %s\n", sender->nickname, message); + + if (flags & SILC_MESSAGE_FLAG_SIGNED) + fprintf(stdout, "[SIGNED] <%s> %s\n", sender->nickname, message); + else + fprintf(stdout, "<%s> %s\n", sender->nickname, message); } @@ -303,6 +307,13 @@ silc_command_reply(SilcClient client, SilcClientConnection conn, silc_client_send_channel_message(client, conn, channel, NULL, 0, "hello", strlen("hello"), FALSE); fprintf(stdout, "MyBot: Sent 'hello' to channel\n"); + + /* Now send digitally signed "hello" to the channel */ + silc_client_send_channel_message(client, conn, channel, NULL, + SILC_MESSAGE_FLAG_SIGNED, + "hello, with signature", + strlen("hello, with signature"), FALSE); + fprintf(stdout, "MyBot: Sent 'hello, with signature' to channel\n"); } va_end(va);