Задайте вопросЗадайте вопрос
 

ОтвеченоAssign strong name to third part DLL

Ответы

  • 12 мая 2006 г. 15:49Sean Hederman Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     Отвечено

    Nope, sn can only be used to sign an assembly that has been delay signed. I doubt that the 3rd party DLL has been delay signed. Even if it had been, you'd need the private key that they delay signed it with.

    I have encountered this problem before. What I've done in that circumstance is simply asked the 3rd party developer to sign the assembly. Failing that I round-trip it through IL and sign it myself.

    So, you use ildasm (http://msdn.microsoft.com/library/en-us/cptools/html/cpconMSILDisassemblerIldasmexe.asp?frame=true) to disassemble it to a .il file and .resources file, and then use ilasm (http://msdn.microsoft.com/library/en-us/cptools/html/cpconMSILAssemblerIlasmexe.asp?frame=true) to reassemble it, passing in your new key. Works a charm unless the assembly is obfuscated.

    Since doing this is technically reverse engineering, it is advised to try and get permission before. Generally 3rd party authors are quite good and will happily supply you with a signed assembly on request. In fact, I've only ever had to use round-tripping once, for a tool we bought, which then became unsupported. I still notified the developer though, and only resorted to round-tripping when he became uncommunicative.

  • 24 мая 2006 г. 0:03Shawn Farkas - MSМодераторМедали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     Отвечено

    This article comes up every so often .... what it shows you how to do is strip the strong name of an assembly, which changes the assembly's identity.  This is not a security issue with the CLR, since you cannot tamper with an assembly and have it maintain the same identity without also having administrative privileges on the local machine.

    Since the assembly identity is used for binding, evaluating matches against StrongNameMembershipCondition, matching InternalsVisibleTo attributes, etc if you've changed the identity you've lost most of what you were gaining in the first place by being able to tamper with the assembly -- you might as well have written the code yourself and signed it with your own key.

    -Shawn

Все ответы