diff options
author | B. Stack <bgstack15@gmail.com> | 2022-05-22 21:09:26 +0000 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-05-22 21:09:26 +0000 |
commit | 54c2e44d7b37b2c3efc449e054eef21fa414dfde (patch) | |
tree | 3894ba7e10c78750c195381a861da5e8166a6bfd /zen/open_ssl.cpp | |
parent | Merge branch 'b11.20' into 'master' (diff) | |
parent | add upstream 11.21 (diff) | |
download | FreeFileSync-54c2e44d7b37b2c3efc449e054eef21fa414dfde.tar.gz FreeFileSync-54c2e44d7b37b2c3efc449e054eef21fa414dfde.tar.bz2 FreeFileSync-54c2e44d7b37b2c3efc449e054eef21fa414dfde.zip |
Merge branch 'b11.21' into 'master'11.21
add upstream 11.21
See merge request opensource-tracking/FreeFileSync!44
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: ")) |