EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SetLicenseKey

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#11712
Posted: 11/17/2009 11:36:47
by Guido Aspesani (Basic support level)
Joined: 11/07/2009
Posts: 7

Hi,
I'm trying to 'include' the demo I done in a simple project (a single exe file)
in our main project.
While in the simple project everithing is ok, in the 'real' project when I call SBUtils.SetLicenseKey I got an AV.

The main difference between the 2 projects is that the 'real' one is a Plugin based projects. it means that a simple small exe loads a number of runtime packages, one of them is a package that has the SetLicenseKey call.
I can't think to other meaningful differences.

Is that a problem? Or maybe is a problem related only to the evaluation key (I am using an evaluation key)

This is the key I am using:

SetLicenseKey('1C05179E26E1DC76816A54C29EBE9F1A0663E6551D1F2F71DD6733FF8C768929' +

'F39AE53D2D4EB24898DBF0A485977CBB9CB138088738616E9A93C60C94138EF1' +

'98B9AC2168A0C5CF909196A921CEB11782E7EE3302BCED9047DC184A5D07E8EC' +

'088ED2481707BA713F921501A774CE73BD008AF926060CBF4AC88682C5608449' +

'B112EB6BCFB60F096E542EBB3B8254FE4680BA57B78CB18366B75841735CA947' +

'9FE56D68EBE65C7CA15CBF93C4B33A372C8EA9346BEF619A90A4B49BDD6988CE' +

'470D8D2EB6EAA600AF13346D68E4F87CABF5D7903F5BFE54601E32A0882AA7E6' +

'FBFA6FDBB1A6E687DA763C096F16F1E92BE46C60572830CF49267186903F484A');


Any other idea ?

Thanks in advance

Guido
#11713
Posted: 11/17/2009 11:51:06
by Eugene Mayevski (EldoS Corp.)

Quote
Guido Aspesani wrote:
The main difference between the 2 projects is that the 'real' one is a Plugin based projects. it means that a simple small exe loads a number of runtime packages, one of them is a package that has the SetLicenseKey call. I can't think to other meaningful differences.


The key itself can't be a problem, however the package-based architecture can.

How is SecureBlackbox linked to plugin(s)?


Sincerely yours
Eugene Mayevski
#11714
Posted: 11/17/2009 12:24:29
by Guido Aspesani (Basic support level)
Joined: 11/07/2009
Posts: 7

Hi Eugene,
The plugin is a plain Delphi run time package, a BPL.
I have referenced the SBB libraries in the 'requires' section,
and called SetLicenseKey after the Create of the object that use the library.

I have also recompiled the 'simple' program (the one that worked) usin runtime packages, and it still works.

I hope this answers your question.

Guido
#11717
Posted: 11/17/2009 12:59:51
by Eugene Mayevski (EldoS Corp.)

Can you reference SecureBlackbox assemblies from the main application (at least for testing)? Try doing this and see if it solves the problem.

Also, if you can build a simple test case and post it's source code here, we would be able to test it and see what's going on internally.


Sincerely yours
Eugene Mayevski
#11731
Posted: 11/17/2009 17:39:03
by Guido Aspesani (Basic support level)
Joined: 11/07/2009
Posts: 7

Eugene,

I already had tryed this, and don't helped (I had inserted all Eldos packages in the runtime packages list of the exe project AND in the required list of the runtime package).
I hoped in a quick solution with a good trick from you, but seems this is not the case.

I will try to produce a simple test case to attach here, but this will be not quick as our main project is quite complex and big.

I will post here asap.

Another try can be (I know I know, not so easy :) ) maybe you can provide me with the source code of the SBUtils unit to track the problem and get a clue ? ....
#11740
Posted: 11/18/2009 08:59:35
by Guido Aspesani (Basic support level)
Joined: 11/07/2009
Posts: 7

Hi Eugene,
While preparing the test case I noticed one thing: the problem I have seems to be linked to the fact that the class that use your library (and thus make the SetLicenceKey call) is NOT a registered delphi class.

I try to explan this a little:
as I already had said we have built a plugin engine, that loads at runtime delphi packages (BPL) and instantiate classes thet resides inside the BPLs.
The problem is that the classes inside the BPLs needs to be registered with the standard function RegisterClass in order to be 'recognized' by delphi at runtime (the exe file is compiled WITHOUT referencing the BPLs... this is the what the plugins are for).
But, sometime, for internal design purposes, some classes descends from some other classes, both inside the BPLs.
In such situation, we 'RegisterClass' ONLY the final class.
This has never caused problems, until now.

If I register the base class also, the AV desappers and everything works normally (well, for what I can see now)

For the moment, while I evaluate in depth your product, I can live with this workaround, but should not be the final solution, for various reason.

Does this make any sense to you?
Is this hint enough to light a bulb in your head? (Italian joke, don't know how to say it in english!)
Is this really a problem/behavior in your library that you can solve/modify?

Thanks in advance for you support

Guido
#11742
Posted: 11/18/2009 09:57:16
by Eugene Mayevski (EldoS Corp.)

And what class(es) do you register this way? Are they SecureBlackbox classes or descendants of SecureBlackbox classes or ... ?


Sincerely yours
Eugene Mayevski
#11746
Posted: 11/18/2009 12:36:05
by Guido Aspesani (Basic support level)
Joined: 11/07/2009
Posts: 7

Usually I register only the class that represent the plugin. In this case, is a class (let's call it ClassB) that descends from another class (ClassA) that in turns use SBB classes.
Registernig not only ClassB but also ClassA apparently solves the problem.
Another info that may help you is that I use also BBS class in this way:

TCSEldosCertificateStorage = class(TCSCertificateStorage)
private
FCertificateStorage: TElPKCS11CertStorage;
protected
function Get_SlotCount: integer; override;
public
constructor Create(Collection: TCollection); override;
destructor Destroy; override;
procedure Open; override;
procedure Close; override;
end;

this class is defined and implemented also inside the BPL, and in turn used by
the ClassB.
It seems that is not needed to register also TCSEldosCertificateStorage to solve the problem.

I hope this helps...

Ciao

Guido
#11749
Posted: 11/18/2009 13:48:22
by Eugene Mayevski (EldoS Corp.)

Frankly speaking I still don't see how this information can help us. If you reference SecureBlackbox code, can't you register it's classes in the BPL itself?

I think you need to play with those registrations to see what combination works and is suitable for you.


Sincerely yours
Eugene Mayevski
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.

Reply

Statistics

Topic viewed 1795 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!