otapij
otapij copied to clipboard
OTServer crashes if an invalid cached key is used during newserver creation.
I found the crash caused by entering the wrong key for the cached key. Here is an excerpt from gdb at the end of the otserver creation process:
BuildFolderPath: Made New Folder: /home/barry/.ot/server_data/contracts/ OTSymmetricKey::SerializeFrom: Error: host_is_generated, Bad value: 288. (Expected 0 or 1.) Passphrase request for: "We do not have a check hash yet for this password, please enter your password" (OT) passphrase: (Verifying) passphrase again:
[New Thread 0x7ffff3bdc700 (LWP 7227)] [Thread 0x7ffff3bdc700 (LWP 7227) exited]
Program received signal SIGSEGV, Segmentation fault. OTPassword::getPasswordSize (this=0x0) at OTPassword.cpp:766 (gdb)
The function that fails is:
uint32_t OTPassword::getPasswordSize() const { OT_ASSERT(m_bIsText); return m_nPasswordSize; }
The program is trying to access m_bIsText inside the OT_ASSERT macro, but the this pointer is NULL.
The call stack is:
#0 OTPassword::getPasswordSize (this=0x0) at OTPassword.cpp:766
#1 0x00007ffff78360f5 in OTAsymmetricKey_OpenSSL::LoadPrivateKeyFromCertString (this=
If you are using the test server data. Then you must enter 'test' . Unfortunately the test server data was generated before we had the password checking code. If you enter the correct key the first time it will not let you make a mistake in the future.
When we update the sample / test data. This issue will go away. It is only an issue when migrating old data.