Skip to content

Commit 9bb2830

Browse files
committed
Merge branch 'master' into vs2010
2 parents 9108ef3 + c69cad3 commit 9bb2830

File tree

101 files changed

+587
-436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+587
-436
lines changed

crypto/NBuild.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<property name="dist-path" value="./dist"/>
1717

1818
<!-- Version -->
19-
<property name="version" value="1.8.0-RC.1"/>
19+
<property name="version" value="1.8.0-RC.2"/>
2020
<property name="name" value="BouncyCastle.Crypto"/>
2121

2222
<property name="OPTIONAL_STRONG_NAME" value="" />

crypto/src/AssemblyInfo.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
[assembly: AssemblyVersion("1.8.*")]
3333

3434
[assembly: CLSCompliant(true)]
35+
#if !PORTABLE
3536
[assembly: ComVisible(false)]
37+
#endif
3638

3739
// Start with no permissions
3840
//[assembly: PermissionSet(SecurityAction.RequestOptional, Unrestricted=false)]

crypto/src/asn1/Asn1Exception.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Org.BouncyCastle.Asn1
55
{
6-
#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT)
6+
#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE)
77
[Serializable]
88
#endif
99
public class Asn1Exception

crypto/src/asn1/Asn1ParsingException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Org.BouncyCastle.Asn1
44
{
5-
#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT)
5+
#if !(NETCF_1_0 || NETCF_2_0 || SILVERLIGHT || PORTABLE)
66
[Serializable]
77
#endif
88
public class Asn1ParsingException

crypto/src/asn1/DerGeneralizedTime.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private string CalculateGmtOffset()
159159
char sign = '+';
160160
DateTime time = ToDateTime();
161161

162-
#if SILVERLIGHT
162+
#if SILVERLIGHT || PORTABLE
163163
long offset = time.Ticks - time.ToUniversalTime().Ticks;
164164
if (offset < 0)
165165
{

crypto/src/asn1/DerUTCTime.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ public DerUtcTime(
8686
public DerUtcTime(
8787
DateTime time)
8888
{
89-
this.time = time.ToString("yyMMddHHmmss") + "Z";
89+
this.time = time.ToString("yyMMddHHmmss", CultureInfo.InvariantCulture) + "Z";
9090
}
9191

92-
internal DerUtcTime(
92+
internal DerUtcTime(
9393
byte[] bytes)
9494
{
9595
//

crypto/src/asn1/cms/AttributeTable.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class AttributeTable
1010
{
1111
private readonly IDictionary attributes;
1212

13-
#if !SILVERLIGHT
13+
#if !(SILVERLIGHT || PORTABLE)
1414
[Obsolete]
1515
public AttributeTable(
1616
Hashtable attrs)
@@ -168,7 +168,7 @@ public IDictionary ToDictionary()
168168
return Platform.CreateHashtable(attributes);
169169
}
170170

171-
#if !SILVERLIGHT
171+
#if !(SILVERLIGHT || PORTABLE)
172172
[Obsolete("Use 'ToDictionary' instead")]
173173
public Hashtable ToHashtable()
174174
{

crypto/src/asn1/cms/Time.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using System;
22
using System.Globalization;
33

4-
using Org.BouncyCastle.Asn1;
5-
64
namespace Org.BouncyCastle.Asn1.Cms
75
{
86
public class Time
@@ -20,13 +18,12 @@ public static Time GetInstance(
2018
public Time(
2119
Asn1Object time)
2220
{
23-
if (!(time is DerUtcTime)
24-
&& !(time is DerGeneralizedTime))
25-
{
21+
if (time == null)
22+
throw new ArgumentNullException("time");
23+
if (!(time is DerUtcTime) && !(time is DerGeneralizedTime))
2624
throw new ArgumentException("unknown object passed to Time");
27-
}
2825

29-
this.time = time;
26+
this.time = time;
3027
}
3128

3229
/**
@@ -37,7 +34,7 @@ public Time(
3734
public Time(
3835
DateTime date)
3936
{
40-
string d = date.ToString("yyyyMMddHHmmss") + "Z";
37+
string d = date.ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture) + "Z";
4138

4239
int year = int.Parse(d.Substring(0, 4));
4340

@@ -56,14 +53,12 @@ public static Time GetInstance(
5653
{
5754
if (obj == null || obj is Time)
5855
return (Time)obj;
59-
6056
if (obj is DerUtcTime)
6157
return new Time((DerUtcTime)obj);
62-
6358
if (obj is DerGeneralizedTime)
6459
return new Time((DerGeneralizedTime)obj);
6560

66-
throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj");
61+
throw new ArgumentException("unknown object in factory: " + obj.GetType().Name, "obj");
6762
}
6863

6964
public string TimeString

crypto/src/asn1/smime/SMIMECapabilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public SmimeCapabilities(
7171
capabilities = seq;
7272
}
7373

74-
#if !SILVERLIGHT
74+
#if !(SILVERLIGHT || PORTABLE)
7575
[Obsolete("Use 'GetCapabilitiesForOid' instead")]
7676
public ArrayList GetCapabilities(
7777
DerObjectIdentifier capability)

crypto/src/asn1/util/Dump.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using Org.BouncyCastle.Asn1;
2-
1+
#if !PORTABLE
32
using System;
43
using System.IO;
54

@@ -26,3 +25,4 @@ public static void Main(string[] args)
2625
}
2726
}
2827
}
28+
#endif

0 commit comments

Comments
 (0)