473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

StrongNameIdentityPermission not checked

I'm not sure whether I'm doing something wrong, or
StrongNameIdentityPermission just doesn't work in 2.0 beta 2 yet.

public class Class1
{
[StrongNameIdentityPermission(SecurityAction.Demand , PublicKey =
Keys.PUBLIC_KEY)]
public Class1()
{
System.Diagnostics.Debug.Assert(Assembly.GetCallin gAssembly().GetName().GetPublicKey().Length
!= 0);
}
}

Obviously the Assert shouldn't evaluate to true, and it doesn't when
compiled to 1.1. However it's clear that the StrongNameIdentityPermission is
being ignored in 2.0 as the assert indeed can evaluate to true.

Is there something different that I've neglected, or has security in the CLR
not been implemented yet?

Thanks in advance

James
Nov 16 '05 #1
2 1838
I was able to reproduce the problem using the December CTP. It looks like a
few changes have been made to StrongNameIdentityPermission, and the problem
seems to lie there rather than in the attribute class. Have you reported
this as a bug?

BTW, there are VStudio 2005-specific newsgroups available at
http://lab.msdn.microsoft.com/vs2005...s/default.aspx
(incl. NNTP connection settings documentation). These would be a better
place for questions pertaining the beta, particularly since they seem to be
monitored by relevant MS staff.

"James Hadwen" <ms*************@7internet.co.uk> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I'm not sure whether I'm doing something wrong, or
StrongNameIdentityPermission just doesn't work in 2.0 beta 2 yet.

public class Class1
{
[StrongNameIdentityPermission(SecurityAction.Demand , PublicKey =
Keys.PUBLIC_KEY)]
public Class1()
{

System.Diagnostics.Debug.Assert(Assembly.GetCallin gAssembly().GetName().GetPublicKey().Length
!= 0);
}
}

Obviously the Assert shouldn't evaluate to true, and it doesn't when
compiled to 1.1. However it's clear that the StrongNameIdentityPermission
is being ignored in 2.0 as the assert indeed can evaluate to true.

Is there something different that I've neglected, or has security in the
CLR not been implemented yet?

Thanks in advance

James

Nov 16 '05 #2
Turns out it might be by design. Looks like the intent might be to allow
fully trusted callers to pass demands for all identity permissions (see the
third paragraph of the 2004-09-17 MS comment at
http://lab.msdn.microsoft.com/produc...-48a4d0c8e6b1).
That said, in my tests, the demand passes even if the "unnamed" caller is
only partially trusted, so the current implementation would seem to be buggy
regardless...

"James Hadwen" <ms*************@7internet.co.uk> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I'm not sure whether I'm doing something wrong, or
StrongNameIdentityPermission just doesn't work in 2.0 beta 2 yet.

public class Class1
{
[StrongNameIdentityPermission(SecurityAction.Demand , PublicKey =
Keys.PUBLIC_KEY)]
public Class1()
{

System.Diagnostics.Debug.Assert(Assembly.GetCallin gAssembly().GetName().GetPublicKey().Length
!= 0);
}
}

Obviously the Assert shouldn't evaluate to true, and it doesn't when
compiled to 1.1. However it's clear that the StrongNameIdentityPermission
is being ignored in 2.0 as the assert indeed can evaluate to true.

Is there something different that I've neglected, or has security in the
CLR not been implemented yet?

Thanks in advance

James

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris | last post by:
I have seen the posts on various places on the internet about .NET framework mismatch issues and I don't think that is my problem. ; ) When I execute the following C++.NET code: String...
0
by: Bnaya | last post by:
I'm invoking the same Dll from Console application and WinForm application Both signed with SrongName. the class that I'm invoking is protected with StrongNameIdentityPermission Demand
0
by: David Riddiford | last post by:
Hi I am trying to protect a class from being used by anything other than the application for which it was intended with StrongNameIdentityPermission using declarative code access security In my...
2
by: | last post by:
I am having a little bit of trouble with the syntax using attributes in classes. The compiler always complaints (VC ++ 2002) on StrongNameIdentityPermission. :-( The intention is secure my...
1
by: dx | last post by:
I'm extremely frustrated with ASP.NET...again! To me this should be as simple as setting oCheckBox.Checked = True.. yet for some reason it isn't. I have a user control (ascx) that that has a...
6
by: Brad | last post by:
I've just used StrongNameIdentityPermission at the class level and it works fine. Can I use it similar to the following for the entire assembly?...
0
by: Simon Hart | last post by:
I can't seem to get this to work. I have applied the above attribute to a class library thats installed in the GAC. I am trying to use this shared assembly from a C# ASP.NET web form, but I am...
0
by: archana | last post by:
Hi all, I am having application in 2003 where i have one class library and two console application. In class library i have one class to which i set strongnameidentitypermission. When i try...
2
by: Ares Chen | last post by:
Hi, all In .NET 1.1, I can protect my assembly by use "StrongNameIdentityPermission", so only the caller with the special StrongName Sign can call my functions in the important assembly. But how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.