Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem installing key

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support
View previous topic :: View next topic  
Author Message
Andrew Rowley



Joined: 24 Dec 2005
Posts: 63

PostPosted: Fri Oct 05, 2007 12:43 pm    Post subject: Problem installing key Reply with quote

I have a user who purchased a license for my product, but the key doesn't work. I have installed it locally and it works fine. The environment is Windows Forms.

I removed the try...catch from EncryptedLicenseProvider.LoadLicense to get the actual error. The exception details are:
Stacktrace:
at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)
at Infralution.Licensing.EncryptedLicenseProvider.LoadLicense(LicenseContext context, Type type, String licenseKey)
at Infralution.Licensing.EncryptedLicenseProvider.GetLicense(String licenseFile)
at Infralution.Licensing.EncryptedLicenseProvider.GetLicense(String licenseParameters, String licenseFile)

Message=CryptoAPI cryptographic service provider (CSP) for this implementation could not be acquired.

All the information I could find referred to ASP etc. which is not the case here.

Do you have any suggestions about what could be the problem? There is obviously something unusual about this user's system, because all other users are OK, but I don't know what.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sat Oct 06, 2007 7:45 am    Post subject: Reply with quote

My guess is their installation of the .NET framework may be corrupted. The only time we have had any errors like this reported has been when calling the licensing classes from a service - which I assume you aren't doing. For services you can set the EncryptedLicenseProvider.UseMachineKeyStore property to true - to overcome the issue.

Does the problem occur for different users (ie admin, non-admin)? What is the operating system and Framework version?
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Andrew Rowley



Joined: 24 Dec 2005
Posts: 63

PostPosted: Sat Oct 06, 2007 12:16 pm    Post subject: Reply with quote

The OS is Windows XP home. Framework is .NET 1.1. I don't really understand what is happening, but I did find some stuff that seemed to suggest you could get the same problem with mandatory profiles because the user couldn't write to the user profile.

I haven't been able to find out yet whether anything like that could be involved here.

I doubt that I can test different users Admin, non-Admin etc - it is difficult remotely.

I am considering trying the UseMachineKeyStore option to see whether it helps, but there is one additional complication - I use Virtual Tree as well - is the licensing for that likely to have the same problem? I don't have the source to set that to UseMachineKeyStore.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sun Oct 07, 2007 11:43 pm    Post subject: Reply with quote

Quote:
The OS is Windows XP home. Framework is .NET 1.1. I don't really understand what is happening, but I did find some stuff that seemed to suggest you could get the same problem with mandatory profiles because the user couldn't write to the user profile.


If they are running XP home then they are very unlikely to be using mandatory profiles.

Quote:
I am considering trying the UseMachineKeyStore option to see whether it helps, but there is one additional complication - I use Virtual Tree as well - is the licensing for that likely to have the same problem? I don't have the source to set that to UseMachineKeyStore.


Setting UseMachineKeyStore to true is worth trying. Virtual Tree does use the same licensing code - so that may be a problem. However if you find that setting UseMachineKeyStore to true fixes the issue then we can change Virtual Tree and get you a patch fairly quickly. What version of Virtual Tree are you using?
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Andrew Rowley



Joined: 24 Dec 2005
Posts: 63

PostPosted: Thu Oct 11, 2007 12:10 am    Post subject: Reply with quote

Setting UseMachineKeyStore fixes the problem.

The user says he does have his machine "pretty much locked down", with various antivirus and antispyware software running.

Is UseMachineKeyStore likely to cause any other issues? I am thinking the best approach might be simply to try UseMachineKeyStore only if the initial attempt to get the license fails. I'm not sure I want to change to UseMachineKeyStore for everyone when it has been working fine up to now.

I am using 2.7 of Virtual Tree.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Oct 11, 2007 7:44 am    Post subject: Reply with quote

Quote:
Is UseMachineKeyStore likely to cause any other issues? I am thinking the best approach might be simply to try UseMachineKeyStore only if the initial attempt to get the license fails. I'm not sure I want to change to UseMachineKeyStore for everyone when it has been working fine up to now.


We are intending to implement that exact solution. You could implement this yourself by modifying the EncryptedLicenseProvider.LoadLicense method to change the creation of the RSACryptoServiceProvider to the following code:

Code:
// If this is not a service or ASP then create the RSA Service Provicer
// using the default user profile key store - if this fails then fall back
// to using the machine key store
//
RSACryptoServiceProvider rsa = null;
if (Environment.UserInteractive && !UseMachineKeyStore)
{
    try
    {
        rsa = new RSACryptoServiceProvider();
     }
     catch
     {
     }
 }

if (rsa == null)
{
     CspParameters cspParams = new CspParameters();
     cspParams.Flags = CspProviderFlags.UseMachineKeyStore;
     rsa = new RSACryptoServiceProvider(cspParams);
}


We should have a release out in the next week or so. Did you encounter an issue with the license verification for Virtual Tree?

If so we will try to get a release out for it at the same time.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Oct 12, 2007 12:47 am    Post subject: Reply with quote

We have now released 3.5.1 of ILS that addresses this issue. You can download the source code using the download links and passwords emailed to you on purchase.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Andrew Rowley



Joined: 24 Dec 2005
Posts: 63

PostPosted: Fri Oct 12, 2007 2:22 am    Post subject: Reply with quote

I can't say for sure whether the virtual tree has the same problem. I have been creating small test programs to gather debugging information, rather than having the user reinstall the application each time. The test program didn't include virtual tree.

However, if it uses RSACryptoServiceProvider the same way, I assume it will have the same problem - I can't see any reason it wouldn't.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Oct 12, 2007 2:25 am    Post subject: Reply with quote

We should have a new release of Virtual Tree available later today to address this potential issue.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Oct 12, 2007 3:30 am    Post subject: Reply with quote

We've now released Version 2.7.3 of Virtual Tree which includes this same fix.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Andrew Rowley



Joined: 24 Dec 2005
Posts: 63

PostPosted: Tue Oct 16, 2007 12:00 am    Post subject: Reply with quote

Great, thanks for your help.
Back to top
View user's profile Send private message
Andrew Rowley



Joined: 24 Dec 2005
Posts: 63

PostPosted: Tue Oct 16, 2007 12:45 am    Post subject: Reply with quote

My application is using .NET 1.1 and Visual Studio 2003 - is it possible to get the licensing changes in version 3.2?
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Oct 16, 2007 5:53 am    Post subject: Reply with quote

See the FAQ on this topic:

http://www.infralution.com/phpBB2/viewtopic.php?t=1027
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Andrew Rowley



Joined: 24 Dec 2005
Posts: 63

PostPosted: Tue Oct 16, 2007 6:10 am    Post subject: Reply with quote

My application is C++ so it's not as simple as "include the classes from the latest version." I have been referencing and shipping the Infralution supplied DLL. To use the latest version I think I need to create a new VS2003 DLL project, and add the various classes to that, correct? Then make sure everything works correctly with the new DLL.

Or maybe I am better off modifying the source in the 3.2 DLL, since it has a VS2003 project included already? That might be less likely to introduce new problems.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Oct 16, 2007 6:42 am    Post subject: Reply with quote

Quote:
My application is C++ so it's not as simple as "include the classes from the latest version


In this case you can copy the source code classes from the VS2005 project into the VS2003 projects and recompile the project. Note that if you do this you should change the strong name used to sign the project - as the strong name we distribute with the source code is publicly available (at least to other Infralution users). We sign our binaries with a different non-public key.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group