[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Workaround in 0.6.0
[Thread Prev] | [Thread Next]
- Subject: Workaround in 0.6.0
- From: Jonathan Walker <jwalker@xxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Thu, 23 Aug 2012 06:59:43 -0700
- To: "libssh@xxxxxxxxxx" <libssh@xxxxxxxxxx>
Hello, Wanted to point out the following to the LibSSH group. My colleague and I were able to successfully build LibSSH 0.6.0 with a few adjustments to the build project. However, when we attempted to utilize the library, we were receiving errors on attempts to authorize with a private key. After much digging around and debugging, we were able to find out that the following conditionals were failing: ssh_pki_import_privkey_file if (size != sb.st_size) { ssh_pki_import_pubkey_file if (size != sb.st_size) { We found that the difference was only one byte in length. After some research, we realized that the newline in our private key file was being counted as 2 bytes (\r\n) in the following function: rc = stat(filename, &sb); However, the following: size = fread(key_buf, 1, sb.st_size, file); Was counting the newline as one byte. In order to solve this issue, we simply opened the file with the "binary" option included: file = fopen(filename, "rb"); Which solved the issue. Thanks, Jonathan ________________________________ This e-mail and any files transmitted with it are ShoreTel property, are confidential, and are intended solely for the use of the individual or entity to whom this e-mail is addressed. If you are not one of the named recipient(s) or otherwise have reason to believe that you have received this message in error, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited
Re: Workaround in 0.6.0 | Andreas Schneider <asn@xxxxxxxxxxxxxx> |