mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-13 17:17:37 -05:00
Allow import.c to read from a BinarySource.
Like sshpubk.c before it, the loading side of import.c now works by first slurping the whole input file into a LoadedFile structure, and then using the BinarySource system to parse the file contents entirely in memory. The old API is still present and works the same as ever, but now we also provide a secondary API that can import a foreign key file from a BinarySource. This is rather a superficial conversion: I've replaced all calls to fgetline() with a local static function bsgetline() which presents more or less the same interface for a BinarySource: that is, it still returns a dynamically allocated string containing the line of text, so that the followup code could change as little as possible. It would be nice to come back in future and modernise this code to use ptrlens throughout, saving all the unnecessary allocations.
This commit is contained in:
Reference in New Issue
Block a user