[Bug 3565] New: keygen do_download_sk() incorrect return value

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Thu Apr 20 22:06:48 AEST 2023


https://bugzilla.mindrot.org/show_bug.cgi?id=3565

            Bug ID: 3565
           Summary: keygen do_download_sk() incorrect return value
           Product: Portable OpenSSH
           Version: 8.5p1
          Hardware: Other
                OS: Windows 10
            Status: NEW
          Severity: minor
          Priority: P5
         Component: ssh-keygen
          Assignee: unassigned-bugs at mindrot.org
          Reporter: m.schmidt at emtec.com

do_download_sk(const char *skprovider, const char *device) in
ssh-keygen.c returns an incorrect value, causing the ssh-keygen -K to
exit with error when all is ok and vice versa.

The end of function looks like this:

        if (i >= nkeys)
                ret = 0; /* success */
        if (pass != NULL)
                freezero(pass, strlen(pass));
        for (i = 0; i < nkeys; i++)
                sshkey_free(keys[i]);
        free(keys);
        return ret ? 0 : -1;


Since ret = 0 is marked as success (see comment above and usual
convention in openssh), just ret should be returned (the return value
makes its way to the program as the exit code).

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list