Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: SSH MAC Algorithm Names

I'm quite sure that it would take you less time to parse the current format, than to write this post and me to make the changes you ask for :)
TheCliGuy

Re: SSH MAC Algorithm Names

Hi Martin,

I've just tested winscp.com /info using 5.18 beta and see that the encrypt-then-MAC algorithms are displayed in parenthesis next to their equivalent encrypt-and-MAC algorithms:

SSH MAC algorithms:

hmac-sha2-256 (hmac-sha2-256-etm@openssh.com)
hmac-sha1 (hmac-sha1-etm@openssh.com)
hmac-sha1-96 (hmac-sha1-96-etm@openssh.com)
hmac-md5 (hmac-md5-etm@openssh.com)


Is there any chance that this could be changed so that ETM algorithms are displayed on separate lines?

Having one algorithm per line makes it very easy to parse the output, EG:

# Create an object ($objAlgorithms) consisting of a property per algorithm type 

# with a value that contains a comma separated list of the algorithm names.

$WinScpInfo = & 'C:\Program Files (x86)\WinSCP\WinSCP.com' /info
$objAlgorithms = [PSCustomObject]@{}

$WinScpInfo.ForEach({
    # A heading is identified as a value ending in a colon.
    If ($_[-1] -eq ':') {
        $PropertyName = ($_.substring(0, ($_.length -1)))
    }
    # The end of a block of algorithms is identified as an empty line.
    ElseIf ($_ -eq '') {
        $objAlgorithms | Add-Member -Name $PropertyName -Type NoteProperty -Value $PropertyVal
        $PropertyVal = ''
    }
    # Anything else is an algorithm name.
    Else {
        If ($PropertyVal) {
            $PropertyVal = $PropertyVal, $_ -join ','
        }
        Else {
            $PropertyVal = $_
        }
    }
})
martin

Re: SSH MAC Algorithm Names

Probably not yet. Still few months to go with 5.18.
TheCliGuy

Re: SSH MAC Algorithm Names

Thank you Martin.

When you say "this is implemented for the next release", is 5.18 going to be the next release after 5.17.9?
TheCliGuy

SSH MAC Algorithm Names

Using WinSCP version 5.17.8, the WinSCP.com /info command returns the following MAC algorithms:

hmac-sha2-256

hmac-sha1
hmac-sha1-96
hmac-md5


Whereas WinSCP actually supports all of the following because for each of the encrypt-and-MAC algorithms above there's an encrypt-then-MAC equivalent:
hmac-sha2-256
hmac-sha1
hmac-sha1-96
hmac-md5
hmac-sha2-256-etm@openssh.com
hmac-sha1-etm@openssh.com
hmac-sha1-96-etm@openssh.com
hmac-md5-etm@openssh.com

Would it be possible to update WinSCP.com /info to list both the encrypt-and-MAC and encrypt-then-MAC algorithms?

The encrypt-then-MAC name can be found in the etm_name property of an ssh2_macalg:

name           etm_name

----           --------
hmac-sha2-256  hmac-sha2-256-etm@openssh.com
hmac-sha1      hmac-sha1-etm@openssh.com
hmac-sha1-96   hmac-sha1-96-etm@openssh.com
hmac-md5       hmac-md5-etm@openssh.com