New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to botan2 from botan #1263
Comments
|
Thank you for your concern. Any pull requests coming up? |
|
Unfortunately can't promise this for now. We trying to package it according to Fedora guidelines and push in official repos and there some issues with this old |
|
For now, botan has been rebuilt without OpenSSL in Fedora 31 and Rawhide. Nonetheless, botan v1 has gone EOL 2018-12-31 and is not supported anymore: https://botan.randombit.net/handbook/support.html |
|
Back then I took botan the Botan source (one big CPP file with no dependencies) from QtCreator (see https://github.com/pbek/QOwnNotes/tree/develop/src/libraries/botan), so it should compile just fine in the future. |
|
Qt Creator seems to have switched to Botan 2 with 4.8 and removed it at all in 4.9. |
|
Embedding such an ancient version of a crypto lib doesn't seem to be a good idea to me: |
|
There seems to be no "single file" botan.cpp in https://github.com/qt-creator/qt-creator/tree/4.8/src/libs/3rdparty/botan |
We just need it for AES encryption and decryption. The new solution needs to work with qmake and cmake, build on all currently supported platforms and distributions and be still able to decrypt encrypted notes from Botan 1. |
|
Also cant build for s390x and ppc64le arches because of bundled |
|
I would not expect a compatibility issue regarding notes encrypted with Botan v1. |
I think I also saw the same on the OpenBuildService... |
|
I managed to compile the project with Botan2, however, encryption/decryption isn't working (cause it's unable to create the hash). |
|
Great, thank you for taking a look at it! |
|
Encryption/Decryption is working now, and is able to decrypt notes from Botan 1. |
|
Are you going to embed it? If so, why? |
|
@thmo Cause it's easier that way and more simple and straightforward. Also, I think it will be more simpler this way when it comes to cross-platform building |
|
@Waqar144 From a distribution perspective, this is discouraged for various reasons (e.g. in case of a security issue, the library can be updated separately). While I see that embedding can be easier for upstream in certain cases, please foresee an option for distro packagers to use the system-wide installed library instead (and therefore, please also refrain from patching the embedded code). |
|
@thmo Not patching the embedded code. |
|
Thank you for the effort, @Waqar144! The windows build seems to fail currently: https://ci.appveyor.com/project/pbek/qownnotes/builds/28104602/job/was94uyoyuuxppuv |
|
The macOS build also fails: https://travis-ci.org/pbek/QOwnNotes/jobs/597831831 |
|
😿 For macOS i don't understand much what's going on. |
It looks like that headers are used that doesn't exist on macOS: |
QON is still built for 32bit because the 64bit build process still doesn't work on AppVeyor and we also need 32bit for Windows XP support (Qt 5.7). |
Yeah, I know. I was just surprised because that part of the code shouldn't have been running even but i understand now. Diving into the code a bit more, I think this one is easy to fix. I will have to remove the For 32 bit support in windows.. I will configure a separate version of botan and then diff it with the 64 bit one to see the differences and maybe it will not be so hard to settle the differences and have a final single file which supports both 64 and 32 bit. |
|
Awesome, I will test the pull request! (btw. no need for force pushing, we can squash merge all commits) ;) |
Regarding the
|
| *g++*:DEFINES += BOTAN_BUILD_COMPILER_IS_GCC | |
| *clang*:DEFINES += BOTAN_BUILD_COMPILER_IS_CLANG |
But these lines differ:
QOwnNotes/src/libraries/botan/botan.cpp
Lines 7400 to 7402 in 567b27e
| #elif defined(BOTAN_BUILD_COMPILER_IS_GCC) || defined(BOTAN_BUILD_COMPILER_IS_CLANG) | |
| #include <cpuid.h> | |
| #endif |
previously there was:
#elif defined(BOTAN_BUILD_COMPILER_IS_GCC) && (BOTAN_GCC_VERSION >= 430)
// Only available starting in GCC 4.3
#include <cpuid.h>
namespace {
/*
* Prevent inlining to work around GCC bug 44174
*/
void __attribute__((__noinline__)) call_gcc_cpuid(Botan::u32bit type,
Botan::u32bit out[4])
{
__get_cpuid(type, out, out+1, out+2, out+3);
}
#define CALL_CPUID call_gcc_cpuid
}|
I changed above code back to the Botan 1 version and tried a new release-build. It's still the same, it fails to build on non-x86 platforms. I've no idea why, any clues @randombit? |
|
On https://build.snapcraft.io/user/pbek/QOwnNotes we can tests commits of QON without releasing. |
|
@pbek just comment this line: QOwnNotes/src/libraries/botan/botan.h Line 92 in 567b27e
and add to both these lines separately in botan.pri: QOwnNotes/src/libraries/botan/botan.pri Lines 32 to 34 in 567b27e
It's failing because on line QOwnNotes/src/libraries/botan/botan.cpp Line 7394 in 567b27e
it checks whether the cpu is x86 or not and since QOwnNotes/src/libraries/botan/botan.h Line 92 in 567b27e
says it is, it goes ahead to include cpuid.h I think this will solve it. |
|
Any PR coming up? 😸 |
|
hahah ok. I will send in a few minutes. |
|
s390x and ppc64el already looking fine on https://build.snapcraft.io/user/pbek/QOwnNotes, great job @Waqar144! |
|
Arm is working fine too, awesome! |
|
Yep! I was just looking at that! Finally made it through for all platforms. |
|
What's still left are all the |
|
Yes, but I don't think they are going to cause any problems. They are just warnings that all this part of code will be made internal (moved into botan_internal?) I can remove these warnings however. |
|
Yes please, best lets remove them in our build, they are just causing confusion. |
|
Meanwhile another release is building. We'll see what happens on https://build.opensuse.org/package/show/home:pbek:QOwnNotes/desktop in the next minutes. 😄 |
|
No wonder the last release on OBS didn't work, it was revision 666. 🤣 Now we are at 667! |
Alright, let's do that. Fingers crossed! I am optimistic it will build this time 😉😁 |
|
The first arm builds are already succeeding. 🎉 |
|
And a big thank you to @randombit for Botan and your concern helping us! |
Haha, That's what i was originally intending to work on lol. |
yes, I did. But there are a lot of issues with it. Starting with the inability to make it build on ApVeyor (Windows) and Travis (for macOS). |
I will try that later. Maybe we can find a way around it. Anyways, on to the spell checker for now. |
|
Yes the warnings are obnoxious sorry about that! Will be fixed in next release. Tracking this in randombit/botan#2164 |
|
Great, thank you for all the work! |
Expected behaviour
Using modern, safe, well maintained libs.
Actual behaviour
Using old, legacy stuff.
The text was updated successfully, but these errors were encountered: