cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURLE_OUT_OF_MEMORY, no way !!

From: <junk_at_igrspace.com>
Date: Tue, 18 Sep 2007 05:27:36 -0700 (PDT)

Hi,

i'm not sure this is can be considered a bug, or it is just a known
limitation.

SFTP transfer fails returning CURLE_OUT_OF_MEMORY when the server supports
public key authentication, CURLOPT_SSH_AUTH_TYPES was not set explicitly
and CURLOPT_SSH_PUBLIC_KEYFILE was not provided.

in ssh.c, ssh_statemach_act():

389 case SSH_AUTH_PKEY_INIT:
390 /*
391 * Check the supported auth types in the order I feel is most secure
392 * with the requested type of authentication
393 */
394 sshc->authed = FALSE;
395
396 if ((data->set.ssh_auth_types & CURLSSH_AUTH_PUBLICKEY) &&
397 (strstr(sshc->authlist, "publickey") != NULL)) {
398 char *home;
399
400 sshc->rsa_pub = sshc->rsa = NULL;
401
402 /* To ponder about: should really the lib be messing about with
the
403 HOME environment variable etc? */
404 home = curl_getenv("HOME");
405
406 if (data->set.str[STRING_SSH_PUBLIC_KEY])
407 sshc->rsa_pub = aprintf("%s",
data->set.str[STRING_SSH_PUBLIC_KEY]);
408 else if (home)
409 sshc->rsa_pub = aprintf("%s/.ssh/id_dsa.pub", home);
410
411 if (sshc->rsa_pub == NULL) {
412 Curl_safefree(home);
413 home = NULL;
414 state(conn, SSH_SESSION_FREE);
415 sshc->actualCode = CURLE_OUT_OF_MEMORY;
416 break;
417 }

line 406, 408 and 411:
i didn't supply it with CURLOPT_SSH_PUBLIC_KEYFILE, home is set to null
(i'm on windows2k). Same for the private key.

is CURLE_OUT_OF_MEMORY a good return value here ?

thanks
Immanuel
Received on 2007-09-18