botan icon indicating copy to clipboard operation
botan copied to clipboard

Is it possible to use botan in a Windows driver project?

Open moccajoghurt opened this issue 4 years ago • 2 comments

It would be awesome to use botan in a Windows driver I am currently maintaining. It seems like botan is only usable in user mode. Is this assumption correct or could it theoretically be compiled as a kernel mode library too?

moccajoghurt avatar Jan 26 '21 10:01 moccajoghurt

We could define an alternative platform target that had limited functionality enabled, basically disabling support for filesystem, Win32 API calls, etc and then adding a few replacements for truly necessary things like getting randomness. This would not be too difficult, the way here has already been paved by support for IncludeOS (which does use Botan from within kernel mode) and bare metal embedded bulids.

Unfortunately it seems that Windows does not support C++ exceptions within the kernel which would be a huge problem. It might be possible to replace it all with SEH but I'm not sure if that's realistic.

randombit avatar Jan 26 '21 10:01 randombit

@moccajoghurt

Check

https://github.com/Bareflank/standalone_cxx

They have exception support and works with Drivers basically you can write Modern C++ there

jeffRTC avatar Jan 31 '21 11:01 jeffRTC

We'd be willing to support this if the patch was not too painful (disabling exceptions is, unfortunately, not in the cards with this codebase) but it seems like there is no current activity here so I'm closing this issue as stale.

randombit avatar Mar 25 '23 11:03 randombit