Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,44 @@
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsRecipient))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsRecipientCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsRecipientEnumerator))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.CmsSigner))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.ContentInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.EnvelopedCms))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.KeyAgreeRecipientInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.KeyTransRecipientInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12Builder))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12CertBag))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12ConfidentialityMode))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12Info))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12IntegrityMode))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12KeyBag))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12SafeBag))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12SafeContents))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12SafeContentsBag))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12SecretBag))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs12ShroudedKeyBag))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs8PrivateKeyInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9AttributeObject))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9ContentType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9DocumentDescription))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9DocumentName))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9LocalKeyId))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9MessageDigest))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Pkcs9SigningTime))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.PublicKeyInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.RecipientInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.RecipientInfoCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.RecipientInfoEnumerator))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.RecipientInfoType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Rfc3161TimestampToken))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.Rfc3161TimestampTokenInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SignedCms))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SignerInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SignerInfoCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SignerInfoEnumerator))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifier))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifierOrKey))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifierOrKeyType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Pkcs.SubjectIdentifierType))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Security.Cryptography.Xml.X509IssuerSerial))]


27 changes: 25 additions & 2 deletions mcs/class/PEAPI/Metadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5658,21 +5658,30 @@ internal class MetaDataStream : BinaryWriter {
char[] name;
Hashtable htable = new Hashtable();
Hashtable btable = new Hashtable (new ByteArrayHashCodeProvider (), new ByteArrayComparer ());
bool addInitByte = false;
bool initByteAdded = false;

internal MetaDataStream(char[] name, bool addInitByte) : base(new MemoryStream())
{
if (addInitByte) { Write((byte)0); size = 1; }
this.addInitByte = addInitByte;
this.name = name;
sizeOfHeader = StreamHeaderSize + (uint)name.Length;
}

internal MetaDataStream(char[] name, System.Text.Encoding enc, bool addInitByte) : base(new MemoryStream(),enc)
{
if (addInitByte) { Write((byte)0); size = 1; }
this.addInitByte = addInitByte;
this.name = name;
sizeOfHeader = StreamHeaderSize + (uint)name.Length;
}

void AddInitByte () {
if (addInitByte && !initByteAdded) {
Write((byte)0);
size += 1;
initByteAdded = true;
}
}
public uint Start {
get { return start; }
set { start = value; }
Expand Down Expand Up @@ -5706,6 +5715,7 @@ internal void WriteDetails()

internal uint Add(string str, bool prependSize)
{
AddInitByte ();
Object val = htable[str];
uint index = 0;
if (val == null) {
Expand All @@ -5723,6 +5733,7 @@ internal uint Add(string str, bool prependSize)
}
internal uint Add (byte[] str, bool prependSize)
{
AddInitByte ();
Object val = btable [str];
uint index = 0;
if (val == null) {
Expand All @@ -5740,6 +5751,7 @@ internal uint Add (byte[] str, bool prependSize)

internal uint Add(Guid guid, bool prependSize)
{
AddInitByte ();
byte [] b = guid.ToByteArray ();
if (prependSize) CompressNum ((uint) b.Length);
Write(guid.ToByteArray());
Expand All @@ -5749,6 +5761,7 @@ internal uint Add(Guid guid, bool prependSize)

internal uint Add(byte[] blob)
{
AddInitByte ();
uint ix = size;
CompressNum((uint)blob.Length);
Write(blob);
Expand All @@ -5758,6 +5771,7 @@ internal uint Add(byte[] blob)

internal uint Add(byte val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (1);
Write(val);
Expand All @@ -5767,6 +5781,7 @@ internal uint Add(byte val, bool prependSize)

internal uint Add(sbyte val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (1);
Write(val);
Expand All @@ -5776,6 +5791,7 @@ internal uint Add(sbyte val, bool prependSize)

internal uint Add(ushort val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (2);
Write(val);
Expand All @@ -5785,6 +5801,7 @@ internal uint Add(ushort val, bool prependSize)

internal uint Add(short val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (2);
Write(val);
Expand All @@ -5794,6 +5811,7 @@ internal uint Add(short val, bool prependSize)

internal uint Add(uint val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (4);
Write(val);
Expand All @@ -5803,6 +5821,7 @@ internal uint Add(uint val, bool prependSize)

internal uint Add(int val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (4);
Write (val);
Expand All @@ -5812,6 +5831,7 @@ internal uint Add(int val, bool prependSize)

internal uint Add(ulong val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (8);
Write(val);
Expand All @@ -5821,6 +5841,7 @@ internal uint Add(ulong val, bool prependSize)

internal uint Add(long val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (8);
Write(val);
Expand All @@ -5830,6 +5851,7 @@ internal uint Add(long val, bool prependSize)

internal uint Add(float val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (4);
Write(val);
Expand All @@ -5839,6 +5861,7 @@ internal uint Add(float val, bool prependSize)

internal uint Add(double val, bool prependSize)
{
AddInitByte ();
uint ix = size;
if (prependSize) CompressNum (8);
Write(val);
Expand Down
Loading