https://bugs.winehq.org/show_bug.cgi?id=56503
Bug ID: 56503 Summary: CryptStringToBinary doesn't adds CR before pad bytes in some cases Product: Wine Version: 9.5 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: crypt32 Assignee: wine-bugs@winehq.org Reporter: dm.klionsky@gmail.com Distribution: ---
Created attachment 76262 --> https://bugs.winehq.org/attachment.cgi?id=76262 Test program
Both CryptStringToBinaryA and CryptStringToBinaryW don't add CR before pad bytes in some cases.
Attached the test program.
``` $ x86_64-w64-mingw32-gcc certcat.c -lcrypt32 -o certcat ```
``` $ wine certcat.exe << EOF
-----BEGIN CERTIFICATE-----
MIICbTCCAhqgAwIBAgIUM7hPfBQsHsiH5ZqG0PbFdVoW4ZwwCgYIKoUDBwEBAwIw gYwxCzAJBgNVBAYTAlJVMSgwJgYDVQQKDB/QmtC+0LQg0JHQtdC30L7Qv9Cw0YHQ vdC+0YHRgtC4MRcwFQYDVQQLDA7Qo9GH0LXQsdC90YvQuTEtMCsGA1UEAwwk0KPQ piDQmtC+0LQg0JHQtdC30L7Qv9Cw0YHQvdC+0YHRgtC4MQswCQYDVQRIDAJjYTAe Fw0yNDAzMTQwODA0MjFaFw0yNTAzMTQwODA0MjFaMGkxCzAJBgNVBAYTAlJVMRMw EQYDVQQKEwphZG1pbjUgb3JnMQ8wDQYDVQQDEwZhZG1pbjUxHjAcBgkqhkiG9w0B CQEWD2FkbWluNUBtYWlsLmNvbTEUMBIGA1UEDRMLYWRtaW41IGRlc2MwZjAfBggq hQMHAQEBATATBgcqhQMCAiQABggqhQMHAQECAgNDAARAr29PncgHl5lwdTnodkAV di1Y9L1fMK/aPhlHgQhZkUjEo/tN4jV7t8oXC5HvuIdEXg5zKBJXJy5r3Ty4oESy 9KNvMG0wDAYDVR0TAQH/BAIwADATBgNVHSUEDDAKBggrBgEFBQcDAjAZBgNVHREE EjAQhg5jNHJvbGU6Ly9hZG1pbjAOBgNVHQ8BAf8EBAMCA+gwHQYDVR0O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