diff options
author | B. Stack <bgstack15@gmail.com> | 2022-05-22 17:03:17 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-05-22 17:03:17 -0400 |
commit | 2c81be72eef5363736cf1892646c74a3311ee4c1 (patch) | |
tree | 3894ba7e10c78750c195381a861da5e8166a6bfd /zen/open_ssl.cpp | |
parent | Merge branch 'b11.20' into 'master' (diff) | |
download | FreeFileSync-2c81be72eef5363736cf1892646c74a3311ee4c1.tar.gz FreeFileSync-2c81be72eef5363736cf1892646c74a3311ee4c1.tar.bz2 FreeFileSync-2c81be72eef5363736cf1892646c74a3311ee4c1.zip |
add upstream 11.21b11.21
Diffstat (limited to 'zen/open_ssl.cpp')
-rw-r--r-- | zen/open_ssl.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/zen/open_ssl.cpp b/zen/open_ssl.cpp index 99d7582e..6dc13d3d 100644 --- a/zen/open_ssl.cpp +++ b/zen/open_ssl.cpp @@ -419,15 +419,13 @@ std::string zen::convertPuttyKeyToPkix(const std::string& keyStream, const std:: { std::vector<std::string> lines; - for (auto it = keyStream.begin();;) //=> keep local: "warning: declaration of ‘it’ shadows a previous local" + split2(keyStream, isLineBreak<char>, + [&lines](const char* blockFirst, const char* blockLast) { - auto itLineBegin = std::find_if_not(it, keyStream.end(), isLineBreak<char>); - if (itLineBegin == keyStream.end()) - break; + if (blockFirst != blockLast) //consider Windows' <CR><LF> + lines.emplace_back(blockFirst, blockLast); + }); - it = std::find_if(itLineBegin + 1, keyStream.end(), isLineBreak<char>); - lines.emplace_back(itLineBegin, it); - } //----------- parse PuTTY ppk structure ---------------------------------- auto itLine = lines.begin(); if (itLine == lines.end() || !startsWith(*itLine, "PuTTY-User-Key-File-2: ")) |