comparison cli-authpubkey.c @ 1094:c45d65392c1a

Fix pointer differ in signess warnings [-Werror=pointer-sign]
author Gaël PORTAY <gael.portay@gmail.com>
date Sat, 02 May 2015 15:59:06 +0200
parents 0da8ba489c23
children aaf576b27a10
comparison
equal deleted inserted replaced
1093:aae71c5f7d5b 1094:c45d65392c1a
61 enum signkey_type keytype; 61 enum signkey_type keytype;
62 unsigned int remotelen; 62 unsigned int remotelen;
63 63
64 TRACE(("enter recv_msg_userauth_pk_ok")) 64 TRACE(("enter recv_msg_userauth_pk_ok"))
65 65
66 algotype = buf_getstring(ses.payload, &algolen); 66 algotype = (char *)buf_getstring(ses.payload, &algolen);
67 keytype = signkey_type_from_name(algotype, algolen); 67 keytype = signkey_type_from_name(algotype, algolen);
68 TRACE(("recv_msg_userauth_pk_ok: type %d", keytype)) 68 TRACE(("recv_msg_userauth_pk_ok: type %d", keytype))
69 m_free(algotype); 69 m_free(algotype);
70 70
71 keybuf = buf_new(MAX_PUBKEY_SIZE); 71 keybuf = buf_new(MAX_PUBKEY_SIZE);
139 139
140 /* TODO: make it take an agent reference to use as well */ 140 /* TODO: make it take an agent reference to use as well */
141 static void send_msg_userauth_pubkey(sign_key *key, int type, int realsign) { 141 static void send_msg_userauth_pubkey(sign_key *key, int type, int realsign) {
142 142
143 const char *algoname = NULL; 143 const char *algoname = NULL;
144 int algolen; 144 unsigned int algolen;
145 buffer* sigbuf = NULL; 145 buffer* sigbuf = NULL;
146 146
147 TRACE(("enter send_msg_userauth_pubkey")) 147 TRACE(("enter send_msg_userauth_pubkey"))
148 CHECKCLEARTOWRITE(); 148 CHECKCLEARTOWRITE();
149 149
150 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST); 150 buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST);
151 151
152 buf_putstring(ses.writepayload, cli_opts.username, 152 buf_putstring(ses.writepayload, (const unsigned char *)cli_opts.username,
153 strlen(cli_opts.username)); 153 strlen(cli_opts.username));
154 154
155 buf_putstring(ses.writepayload, SSH_SERVICE_CONNECTION, 155 buf_putstring(ses.writepayload, (const unsigned char *)SSH_SERVICE_CONNECTION,
156 SSH_SERVICE_CONNECTION_LEN); 156 SSH_SERVICE_CONNECTION_LEN);
157 157
158 buf_putstring(ses.writepayload, AUTH_METHOD_PUBKEY, 158 buf_putstring(ses.writepayload, (const unsigned char *)AUTH_METHOD_PUBKEY,
159 AUTH_METHOD_PUBKEY_LEN); 159 AUTH_METHOD_PUBKEY_LEN);
160 160
161 buf_putbyte(ses.writepayload, realsign); 161 buf_putbyte(ses.writepayload, realsign);
162 162
163 algoname = signkey_name_from_type(type, &algolen); 163 algoname = signkey_name_from_type(type, &algolen);
164 164
165 buf_putstring(ses.writepayload, algoname, algolen); 165 buf_putstring(ses.writepayload, (const unsigned char *)algoname, algolen);
166 buf_put_pub_key(ses.writepayload, key, type); 166 buf_put_pub_key(ses.writepayload, key, type);
167 167
168 if (realsign) { 168 if (realsign) {
169 TRACE(("realsign")) 169 TRACE(("realsign"))
170 /* We put the signature as well - this contains string(session id), then 170 /* We put the signature as well - this contains string(session id), then