CLogDlg::MonitorEditProject remove \r and \n from encrypted username/password

Daniel Sahlberg via TortoiseSVN-dev <[email protected]> Mon, 21 Nov 2022 16:21:47 -0800 (PST)
Newsgroups gmane.comp.version-control.subversion.tortoisesvn.devel
Message-ID <[email protected]>
Hi,

While investigating another issue in the Project Monitor, I saw the 
following code in MonitorEditProject:

[[[
        pEditProject->username = CStringUtils::Encrypt(dlg.m_sUsername);
        pEditProject->password = CStringUtils::Encrypt(dlg.m_sPassword);
        pEditProject->username.Remove('\r');
        pEditProject->password.Remove('\r');
        pEditProject->username.Replace('\n', ' ');
        pEditProject->password.Replace('\n', ' ');
]]]

Is there a guarantee that CryptBinaryToStringW (called by Encrypt) cannot 
return \r or \n in the encrypted (and formatted) data?

The code was added in r25576. In r25909, the flag CRYPT_STRING_NOCRLF was 
added in the call to CryptBinaryToStringW.

Kind regards,
Daniel

-- 
You received this message because you are subscribed to the Google Groups "TortoiseSVN-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/tortoisesvn-dev/7c0a7ba6-57a2-4021-bc60-c1340a370f0dn%40googlegroups.com.