EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SQL 2005 CLR

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#3010
Posted: 05/29/2007 09:05:13
by Jesse Terrell (Standard support level)
Joined: 05/29/2007
Posts: 24

I'm trying to use the SecureBlackbox SFTP dlls on my SQL Server 2005 inside a CLR stored procedure. How can I make SQL Server recognize and see the SecureBlackbox assemblies? I have tried using "Create Assembly" in Sql Server but get the error message "Msg 6211, Level 16, State 1, Line 3
CREATE ASSEMBLY failed because type 'SBIDEA.__Global' in external_access assembly 'SecureBlackbox' has a static field 'IdeaEnabled'. Attributes of static fields in external_access assemblies must be marked readonly in Visual C#, ReadOnly in Visual Basic, or initonly in Visual C++ and intermediate language." Does anyone have any help or suggestions for where I can find more information?
#3011
Posted: 05/29/2007 09:46:28
by Eugene Mayevski (EldoS Corp.)

In case of IDEA stuff, you can download build 5.1.0.112 from the site. It doesn't include IDEA.

As for SQL Server 2005 in general, - we didn't yet test SBB with it so we can't tell anything concrete.


Sincerely yours
Eugene Mayevski
#3012
Posted: 05/29/2007 10:10:48
by Jesse Terrell (Standard support level)
Joined: 05/29/2007
Posts: 24

Thank you for the information. I tried it but it still doesn't work. I get the error message:

Msg 6211, Level 16, State 1, Line 3
CREATE ASSEMBLY failed because type 'SBSocket.__Global' in external_access assembly 'SecureBlackbox' has a static field 'LastNetError'. Attributes of static fields in external_access assemblies must be marked readonly in Visual C#, ReadOnly in Visual Basic, or initonly in Visual C++ and intermediate language.


I'm trying to use the tool without having a user involved using either an SQL scheduled job or a window's service. The SQL route isn't working becuase I can't create the SecureBlackbox assemblies for the CLR to use so now I'm going to try to create a window's service. I'll post my results for others after the attempt.

Thanks.
#3013
Posted: 05/29/2007 10:38:09
by Eugene Mayevski (EldoS Corp.)

Thank you for the test. I have no idea what "attributes" are and how they must be marked as read-only. Readdressed this question to compiler developers.


Sincerely yours
Eugene Mayevski
#3021
Posted: 05/30/2007 02:47:48
by Eugene Mayevski (EldoS Corp.)

We have investigated the issue and found out, that SQL Server puts tight restrictions on the assemblies being loaded. Due to this we need to create a special (separate) assemply set for SQL Server 2005. We will try to do this for 5.2 release, but I can't promise, as it's not clear yet, what amount of changes in the code is required. It's possible that we will postpone this to SecureBlackbox 6.0 which is planned for autumn.


Sincerely yours
Eugene Mayevski
#3036
Posted: 06/01/2007 09:31:13
by Charles Poston (Standard support level)
Joined: 06/12/2006
Posts: 15

Using the following T-SQL, I have been able to load the exising Assemblies and use them in SQL 2005:

-- Need to have this set (one way or another!)
--alter database dummy set trustworthy on

create assembly SecureBlackboxPGP
from 'C:\Program Files\EldoS\SecureBlackbox.NET\Assemblies\NET_20\SecureBlackbox.PGP.dll'
with permission_set = unsafe

create assembly SecureBlackboxPKI
from 'C:\Program Files\EldoS\SecureBlackbox.NET\Assemblies\NET_20\SecureBlackbox.PKI.dll'
with permission_set = unsafe

create assembly SecureBlackbox
from 'C:\Program Files\EldoS\SecureBlackbox.NET\Assemblies\NET_20\SecureBlackbox.dll'
with permission_set = unsafe

create assembly SecureBlackboxSFTP
from 'C:\Program Files\EldoS\SecureBlackbox.NET\Assemblies\NET_20\SecureBlackbox.SFTP.dll'
with permission_set = unsafe

#3069
Posted: 06/05/2007 10:26:13
by Jesse Terrell (Standard support level)
Joined: 05/29/2007
Posts: 24

Thank you for the information. I have also been able to get the assemblies to load into SQL Server. One note though, you may need to edit your "projectname.csproj" file to add the references to your project. VS2005 seems to be picky about what references the IDE will let you add without directly editing the project file.



<Reference Include="SecureBlackbox">
<Name>SecureBlackbox</Name>
</Reference>
<Reference Include="SecureBlackbox.FTPS">
<Name>SecureBlackbox.FTPS</Name>
</Reference>
<Reference Include="SecureBlackbox.PKI">
<Name>SecureBlackbox.PKI</Name>
</Reference>
<Reference Include="SecureBlackbox.SSLClient">
<Name>SecureBlackbox.SSLClient</Name>
</Reference>
<Reference Include="SecureBlackbox.SSLCommon">
<Name>SecureBlackbox.SSLCommon</Name>
</Reference>

#3072
Posted: 06/05/2007 11:23:10
by Charles Poston (Standard support level)
Joined: 06/12/2006
Posts: 15

If you create a Database project (File/New/Project/Other Project Types/Database/Database Project) and you select Add Reference from the Solution Explorer don't you see the Assemblies listed on the SQL Server tab page list? I do.
#3076
Posted: 06/05/2007 16:06:41
by Jesse Terrell (Standard support level)
Joined: 05/29/2007
Posts: 24

No, only a few System assemblies, CustomMarshers, Microsoft.VisualBasic, Microsoft.VisualC and mscorlib show on my assemblies list when I choose Add References. To get the SecureBlackBox assemblies to appear I have to manually edit the project file and add them myself. I think the VS2005 editor won't show them unless they are on Microsoft's "approved CLR" assembly list. Just a guess.
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 3621 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!