Re: [Smartsign-users] Patch for openssh-mcard
Status: Pre-Alpha
Brought to you by:
kefren
|
From: Tommaso C. <cuc...@ss...> - 2004-09-24 18:39:14
|
Thanks, I'll integrate into a new release after possibly testing
compilation on FedoraCore 2, which I'm currently using.
I know, openssh is at 3.9 ! I do not have time for re-patching the
openssh for each and every new release. If they don't integrate the
(few) #ifdef within their sources, this is likely to remain a patch
for the old and obsolete 3.5p1 !!
T.
Bruce Barnett wrote:
>
> Here are some patches for openssh-mcard-3.5p1 for
>
> I'm using Fedora Core 1, pcsc-lite-1.2.9beta6
>
>
> It fixed the following problems/warning
> 1) Using a predefined math function (log() )
> 2) A bug with one call to MyLog
> 3) Eliminated the use of the deprecated LPSTR type
> 4) Various warnings about using unitialized variables
> 5) redefining some predefined variables (ushort)
> 6) a missing include file
>
>
>
>
> --- ./muscle-card/my_util.c.orig 2003-01-13 11:19:23.000000000 -0500
> +++ ./muscle-card/my_util.c 2004-09-21 17:09:09.000000000 -0400
> @@ -143,8 +143,8 @@
> }
>
> char *GetReader(SCARDCONTEXT hContext, int dev_nb) {
> - LPSTR mszReaders = NULL;
> - LPSTR mszReader;
> + LPTSTR mszReaders = NULL;
> + LPTSTR mszReader;
> DWORD dwReaders;
> int count = 0;
> int i = 0;
> @@ -178,7 +178,7 @@
> }
>
> int SCU_Initialize(int dev_nb, SCARDCONTEXT *p_hContext, SCARDHANDLE *p_hCard) {
> - LPSTR mszReader;
> + LPTSTR mszReader;
> DWORD dwPref;
> LONG rv;
>
> @@ -258,7 +258,7 @@
> }
>
> int Activate(int dev_nb, SCARDCONTEXT *p_hContext, SCARDHANDLE *p_hCard) {
> - LPSTR mszReader = NULL;
> + LPTSTR mszReader = NULL;
> // SCARD_READERSTATE_A rgReaderStates;
> DWORD dwPref;
> LONG rv;
> --- ./muscle-card/card_edge_openssl.c.orig 2003-01-13 11:19:23.000000000 -0500
> +++ ./muscle-card/card_edge_openssl.c 2004-09-21 17:11:59.000000000 -0400
> @@ -5,7 +5,7 @@
>
> #define CHECK(cond, msg, rv) { if (!(cond)) { printf("Error: %s\n", msg); return rv; } }
>
> -typedef unsigned short ushort;
> +/* typedef unsigned short ushort; */
>
> static void setUshort(byte *p_buf, ushort val) {
> p_buf[0] = (byte) (val >> 8);
> --- ./log.h.orig 2003-01-13 11:19:23.000000000 -0500
> +++ ./log.h 2004-09-21 16:58:47.000000000 -0400
> @@ -55,7 +55,8 @@
>
> void fatal(const char *, ...) __attribute__((format(printf, 1, 2)));
> void error(const char *, ...) __attribute__((format(printf, 1, 2)));
> -void log(const char *, ...) __attribute__((format(printf, 1, 2)));
> +#define log my_log
> +void my_log(const char *, ...) __attribute__((format(printf, 1, 2)));
> void verbose(const char *, ...) __attribute__((format(printf, 1, 2)));
> void debug(const char *, ...) __attribute__((format(printf, 1, 2)));
> void debug2(const char *, ...) __attribute__((format(printf, 1, 2)));
> --- ./key.c.orig 2003-01-24 07:03:21.000000000 -0500
> +++ ./key.c 2004-09-21 16:38:06.000000000 -0400
> @@ -47,6 +47,7 @@
> #include "log.h"
>
> #ifdef USE_SSP_LITE
> +# include <wintypes.h>
> # include <winscard.h>
> # include "muscle-card/rsa_cardedge.h"
> # define CHECK(cond, msg) if (!(cond)) { log("Error: %s\n", msg); goto err; }
> --- ./sftp.c.orig 2003-01-13 11:19:23.000000000 -0500
> +++ ./sftp.c 2004-09-21 17:11:58.000000000 -0400
> @@ -110,7 +110,8 @@
> {
> int in, out, ch;
> pid_t sshpid;
> - char *host, *userhost, *cp, *file2;
> + char *host, *userhost, *cp;
> + char *file2 = NULL;
> int debug_level = 0, sshver = 2;
> char *file1 = NULL, *sftp_server = NULL;
> char *ssh_program = _PATH_SSH_PROGRAM, *sftp_direct = NULL;
> --- ./sftp-client.c.orig 2003-01-13 11:19:23.000000000 -0500
> +++ ./sftp-client.c 2004-09-21 17:13:13.000000000 -0400
> @@ -752,6 +752,7 @@
>
> TAILQ_INIT(&requests);
>
> + status = 0;
> a = do_stat(conn, remote_path, 0);
> if (a == NULL)
> return(-1);
> @@ -968,7 +969,7 @@
> TAILQ_ENTRY(outstanding_ack) tq;
> };
> TAILQ_HEAD(ackhead, outstanding_ack) acks;
> - struct outstanding_ack *ack;
> + struct outstanding_ack *ack = NULL;
>
> TAILQ_INIT(&acks);
>
> --- ./scp.c.orig 2003-01-13 11:19:23.000000000 -0500
> +++ ./scp.c 2004-09-21 17:11:58.000000000 -0400
> @@ -487,6 +487,7 @@
> char *last, *name, buf[2048];
> int len;
>
> + fd=0;
> for (indx = 0; indx < argc; ++indx) {
> name = argv[indx];
> statbytes = 0;
> --- ./ssh-agent.c.orig 2003-01-13 11:19:23.000000000 -0500
> +++ ./ssh-agent.c 2004-09-24 10:55:56.000000000 -0400
> @@ -426,7 +426,7 @@
> MyLog(0, "Creating KEY_SSPLITE key...");
> k = key_new(KEY_SSP_LITE);
> if (k != NULL) {
> - MyLog("Infering pin_nb: %d", rsa_sc_infer_pin_number(k->rsa));
> + MyLog(0, "Infering pin_nb: %d", rsa_sc_infer_pin_number(k->rsa));
> MyLog(0, "Providing pin...");
> if (rsa_sc_provide_pin(k->rsa, pin, pin_length) == RSA_SC_OK) {
> rsa_sc_set_prv_key_num(k->rsa, prv_key_nb);
> --- ./ssh-keygen.c.orig 2003-01-24 07:03:47.000000000 -0500
> +++ ./ssh-keygen.c 2004-09-24 10:52:43.000000000 -0400
> @@ -759,7 +759,8 @@
> int
> main(int ac, char **av)
> {
> - char dotsshdir[MAXPATHLEN], comment[1024], *passphrase1, *passphrase2;
> + char dotsshdir[MAXPATHLEN], comment[1024], *passphrase2;
> + char *passphrase1= NULL;
> char *reader_id = NULL;
> Key *private, *public;
> struct passwd *pw;
> --- ./ssh-keysign.c.orig 2003-01-13 11:19:23.000000000 -0500
> +++ ./ssh-keysign.c 2004-09-24 11:03:46.000000000 -0400
> @@ -62,6 +62,7 @@
> int pktype, fail;
>
> fail = 0;
> + key = NULL;
>
> buffer_init(&b);
> buffer_append(&b, data, datalen);
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> Project Admins to receive an Apple iPod Mini FREE for your judgement on
> who ports your project to Linux PPC the best. Sponsored by IBM.
> Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
> _______________________________________________
> Smartsign-users mailing list
> Sma...@li...
> https://lists.sourceforge.net/lists/listinfo/smartsign-users
|