<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Troy,<br>
<br>
BibleTime stores the key in its $HOME/.bibletime/bibletimerc file.
It sends it to sword using SWMgr::setCipherKey(). I don't see the
key in the $HOME/.sword/mods.d/net.conf file.<br>
<br>
The BibleTime test for being unlocked looks like this:<br>
<br>
bool CSwordModuleInfo::unlockKeyIsValid() const {<br>
m_module->setPosition(sword::TOP);<br>
<br>
// This needs to use ::fromLatin1 because if the text is still
locked,<br>
// a lot of garbage will show up. It will also work with
properly decrypted<br>
// Unicode text, because all non-ASCII Unicode chars consist of
bytes >127<br>
// and therefore contain no control (nonprintable) characters,
which are all <127.<br>
QString test = isUnicode()<br>
?
QString::fromUtf8(m_module->getRawEntryBuf().c_str())<br>
: QString::fromLatin1(
m_module->getRawEntryBuf().c_str() );<br>
<br>
if (test.isEmpty()) {<br>
return false;<br>
}<br>
<br>
for (int i = 0; i <= test.length() && i < 100;
i++) {<br>
if ( !test[i].isPrint() && !test[i].isNull() ) {<br>
return false;<br>
}<br>
}<br>
<br>
return true;<br>
}<br>
<br>
When the failure to think it is unlocked occurs, the
getRawEntryBuf() is returning an empty string. Does that seem right?<br>
<br>
Gary<br>
<br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<pre style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">>SWORD does not have a means to determine if a key is valid, other than user confirmation that they see ungarbled text. This is intentional to impede brute force key hacking.
>
>I am not sure what logic BT uses to determine if a module is unlocked, but in BibleCS we ask the user for the key, use the key to retrieve text from the module, and then ask them if everything looks ok. Then save the key in the .conf file. If the .conf file has a key, we assume it has been unlocked. Hope this helps.
>
>Troy</pre>
<br>
<br>
On 05/12/2012 11:04 AM, Gary Holmlund wrote:
<blockquote cite="mid:4FAEA621.5090206@gmail.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<div class="moz-text-flowed" style="font-family: -moz-fixed;
font-size: 12px;" lang="x-western">I have been investigating
issues in BibleTime related to locked modules. I have found a
repeatable case I have tried in 2.8, 2.9 and 2.10git on linux. I
can have a window open to the NET Bible (paid version, I have
the key installed) and am able to change Bible references, etc.
but at the same time the Bookshelf will show the module as being
locked and won't let me open another window. So it appears that
the method of determining locked status in the Bookshelf is not
consistent with the module actually being unlocked. <br>
<br>
The module is unlocked when we call setCipherKey in
CSwordModuleInfo. This is working fine. <br>
<br>
The Bookshelf calls CSwordModuleInfo::unlockKeyIsValid() to
determine if the module is unlocked. In the repeatable problem
case the unlockKeyIsValid function calls getRawEntryBuf in sword
and it returns an empty string which indicates the module is
locked. I have debugged down into sword at this point, but
because of the lack of comments in sword code and the fact that
involves calculating offsets into buffers (no documentation on
how this works), uncompress, etc. I have not been able to figure
out where the problem is. <br>
<br>
I am getting a little frustrated and wondering if anyone has
thoughts about this. <br>
<br>
Here is the repeatable case: <br>
<br>
Open BibleTime <br>
Open NET Bible (paid version with key) <br>
Open ESV Bible in parallel in same window as NET Bible <br>
Changing verse references works fine. <br>
Bookshelf shows NET Bible unlocked <br>
Close BibleTime <br>
Open BibleTime <br>
Session is restored showing NET and ESV in parallel <br>
Changing verse references works fine. <br>
Bookshelf shows NET Bible locked <--- error <br>
Remove the ESV Bible that is in parallel <br>
Bookshelf show NET Bible unlocked <br>
<br>
I have not seen the problem without having a second Bible in
parallel with NET. I am not sure how to write a small example
using only sword. I was able to write a small example for a
different sword issue recently. <br>
<br>
Gary <br>
<br>
<br>
</div>
</blockquote>
<br>
</body>
</html>