Skip to content

Commit 559ca6c

Browse files
committed
compatibility updates.
latest for releasenotes.
1 parent df09724 commit 559ca6c

35 files changed

Lines changed: 742 additions & 53 deletions

File tree

ant/jdk13.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@
5656
<exclude name="**/asymmetric/dstu/*.java" />
5757
<exclude name="**/provider/config/PKCS12StoreParameter.java" />
5858
</fileset>
59-
<fileset dir="util/src/main/java"/>
59+
<fileset dir="util/src/main/java">
60+
<exclude name="**/oer/**" />
61+
<exclude name="**/its/**" />
62+
</fileset>
6063
<fileset dir="prov/src/main/java">
6164
<exclude name="**/BCFKSStoreParameter.java" />
6265
<exclude name="**/ec/ECUtils.java" />
@@ -109,6 +112,7 @@
109112
<exclude name="**/pkix/jcajce/RFC3280Cert*.java" />
110113
<exclude name="**/mime/**/*.java" />
111114
<exclude name="**/est/**/*.java" />
115+
<exclude name="**/its/**" />
112116
</fileset>
113117
<fileset dir="pg/src/main/java">
114118
<exclude name="**/keybox/*.java" />
@@ -218,6 +222,7 @@
218222
<exclude name="**/PKIXRevocationTest.java" />
219223
<exclude name="**/cms/test/AnnotatedKeyTest.java"/>
220224
<exclude name="**/bouncycastle/cms/test/AuthEnvelopedDataTest.java"/>
225+
<exclude name="**/its/**" />
221226
</fileset>
222227
<fileset dir="mail/src/test/java">
223228
<exclude name="**/SignedMailValidatorTest.java" />
@@ -303,7 +308,6 @@
303308
<exclude name="**/MultipartParserTest.java"/>
304309
</fileset>
305310
</replaceregexp>
306-
<replaceregexp match="\.\.\." replace="[]" flags="g" byline="true">
307311
<replaceregexp match="\.\.\." replace="[]" flags="g" byline="true">
308312
<fileset dir="${src.dir}">
309313
<include name="**/*.java"/>

bc-build.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

2-
release.suffix: 170b08
3-
release.name: 1.70b08
4-
release.version: 1.69.99
5-
release.debug: true
2+
release.suffix: 170
3+
release.name: 1.70
4+
release.version: 1.70.00
5+
release.debug: false
66

77
mail.jar.home: ./libs/mail.jar
88
activation.jar.home: ./libs/activation.jar

build1-2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ find $jdk12src -name "*.java" -exec scripts/usejcecert.sh \{\} \;
9292
rm org/bouncycastle/cms/jcajce/JceAADStream.java
9393
rm org/bouncycastle/jcajce/provider/keystore/util/ParameterUtil.java
9494
rm -rf org/bouncycastle/jce/provider/test/SimpleTestTest.java
95-
rm -rf org/bouncycastle/sasn1/test
95+
rm -rf org/bouncycastle/oer
9696
rm -rf org/bouncycastle/i18n/test
9797
rm -rf org/bouncycastle/i18n/filter/test
9898
rm -rf org/bouncycastle/math/ec/test
@@ -167,6 +167,7 @@ find $jdk12src -name "*.java" -exec scripts/usejcecert.sh \{\} \;
167167
rm -rf org/bouncycastle/jcajce/provider/asymmetric/util/EC5*.java
168168
rm org/bouncycastle/asn1/test/EnumeratedTest.java
169169
rm -rf org/bouncycastle/pqc/crypto/test/QT*.java
170+
rm -rf org/bouncycastle/pqc/crypto/test/SphincsPlusTest.java
170171
rm -rf org/bouncycastle/pqc/crypto/qtesla/QT*Tests.java
171172
rm -rf org/bouncycastle/pqc/jcajce/provider/test
172173
rm -r org/bouncycastle/crypto/test/speedy

core/src/main/java/org/bouncycastle/asn1/x509/ExtensionsGenerator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.bouncycastle.asn1.ASN1EncodableVector;
1313
import org.bouncycastle.asn1.ASN1Encoding;
1414
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
15+
import org.bouncycastle.asn1.ASN1ParsingException;
1516
import org.bouncycastle.asn1.ASN1Sequence;
1617
import org.bouncycastle.asn1.DEROctetString;
1718
import org.bouncycastle.asn1.DERSequence;
@@ -99,7 +100,7 @@ public void addExtension(
99100
}
100101
catch (IOException e)
101102
{
102-
throw new RuntimeException(e.getMessage(), e);
103+
throw new ASN1ParsingException(e.getMessage(), e);
103104
}
104105
}
105106
else
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package org.bouncycastle.asn1;
2+
3+
/**
4+
* DER BMPString object encodes BMP (<i>Basic Multilingual Plane</i>) subset
5+
* (aka UCS-2) of UNICODE (ISO 10646) characters in codepoints 0 to 65535.
6+
* <p>
7+
* At ISO-10646:2011 the term "BMP" has been withdrawn, and replaced by
8+
* term "UCS-2".
9+
* </p>
10+
*/
11+
public class DERBMPString
12+
extends ASN1BMPString
13+
{
14+
/**
15+
* Basic constructor
16+
* @param string a String to wrap as a BMP STRING.
17+
*/
18+
public DERBMPString(String string)
19+
{
20+
super(string);
21+
}
22+
23+
/**
24+
* Basic constructor - byte encoded string.
25+
* @param string the encoded BMP STRING to wrap.
26+
*/
27+
DERBMPString(byte[] contents)
28+
{
29+
super(contents);
30+
}
31+
32+
DERBMPString(char[] string)
33+
{
34+
super(string);
35+
}
36+
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
package org.bouncycastle.asn1;
2+
3+
import java.io.IOException;
4+
5+
/**
6+
* A BIT STRING with DER encoding - the first byte contains the count of padding bits included in the byte array's last byte.
7+
*/
8+
public class DERBitString
9+
extends ASN1BitString
10+
{
11+
public static DERBitString convert(ASN1BitString bitString)
12+
{
13+
return (DERBitString)bitString.toDERObject();
14+
}
15+
16+
public DERBitString(byte[] data)
17+
{
18+
this(data, 0);
19+
}
20+
21+
public DERBitString(byte data, int padBits)
22+
{
23+
super(data, padBits);
24+
}
25+
26+
public DERBitString(byte[] data, int padBits)
27+
{
28+
super(data, padBits);
29+
}
30+
31+
public DERBitString(int value)
32+
{
33+
// TODO[asn1] Unify in single allocation of 'contents'
34+
super(getBytes(value), getPadBits(value));
35+
}
36+
37+
public DERBitString(ASN1Encodable obj) throws IOException
38+
{
39+
// TODO[asn1] Unify in single allocation of 'contents'
40+
super(obj.toASN1Primitive().getEncoded(ASN1Encoding.DER), 0);
41+
}
42+
43+
DERBitString(byte[] contents, boolean check)
44+
{
45+
super(contents, check);
46+
}
47+
48+
boolean encodeConstructed()
49+
{
50+
return false;
51+
}
52+
53+
int encodedLength(boolean withTag)
54+
{
55+
return ASN1OutputStream.getLengthOfEncodingDL(withTag, contents.length);
56+
}
57+
58+
void encode(ASN1OutputStream out, boolean withTag) throws IOException
59+
{
60+
int padBits = contents[0] & 0xFF;
61+
int length = contents.length;
62+
int last = length - 1;
63+
64+
byte lastOctet = contents[last];
65+
byte lastOctetDER = (byte)(contents[last] & (0xFF << padBits));
66+
67+
if (lastOctet == lastOctetDER)
68+
{
69+
out.writeEncodingDL(withTag, BERTags.BIT_STRING, contents);
70+
}
71+
else
72+
{
73+
out.writeEncodingDL(withTag, BERTags.BIT_STRING, contents, 0, last, lastOctetDER);
74+
}
75+
}
76+
77+
ASN1Primitive toDERObject()
78+
{
79+
return this;
80+
}
81+
82+
ASN1Primitive toDLObject()
83+
{
84+
return this;
85+
}
86+
87+
static DERBitString fromOctetString(ASN1OctetString octetString)
88+
{
89+
return new DERBitString(octetString.getOctets(), true);
90+
}
91+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package org.bouncycastle.asn1;
2+
3+
/**
4+
* ASN.1 GENERAL-STRING data type.
5+
* <p>
6+
* This is an 8-bit encoded ISO 646 (ASCII) character set
7+
* with optional escapes to other character sets.
8+
* </p>
9+
*/
10+
public class DERGeneralString
11+
extends ASN1GeneralString
12+
{
13+
/**
14+
* Construct a GeneralString from the passed in String.
15+
*
16+
* @param string the string to be contained in this object.
17+
*/
18+
public DERGeneralString(String string)
19+
{
20+
super(string);
21+
}
22+
23+
DERGeneralString(byte[] contents, boolean clone)
24+
{
25+
super(contents, clone);
26+
}
27+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package org.bouncycastle.asn1;
2+
3+
public class DERGraphicString
4+
extends ASN1GraphicString
5+
{
6+
public DERGraphicString(byte[] octets)
7+
{
8+
this(octets, true);
9+
}
10+
11+
DERGraphicString(byte[] contents, boolean clone)
12+
{
13+
super(contents, clone);
14+
}
15+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package org.bouncycastle.asn1;
2+
3+
/**
4+
* DER IA5String object - this is a ISO 646 (ASCII) string encoding code points 0 to 127.
5+
* <p>
6+
* Explicit character set escape sequences are not allowed.
7+
* </p>
8+
*/
9+
public class DERIA5String
10+
extends ASN1IA5String
11+
{
12+
/**
13+
* Basic constructor - without validation.
14+
* @param string the base string to use..
15+
*/
16+
public DERIA5String(String string)
17+
{
18+
this(string, false);
19+
}
20+
21+
/**
22+
* Constructor with optional validation.
23+
*
24+
* @param string the base string to wrap.
25+
* @param validate whether or not to check the string.
26+
* @throws IllegalArgumentException if validate is true and the string
27+
* contains characters that should not be in an IA5String.
28+
*/
29+
public DERIA5String(String string, boolean validate)
30+
{
31+
super(string, validate);
32+
}
33+
34+
DERIA5String(byte[] contents, boolean clone)
35+
{
36+
super(contents, clone);
37+
}
38+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package org.bouncycastle.asn1;
2+
3+
/**
4+
* DER NumericString object - this is an ascii string of characters {0,1,2,3,4,5,6,7,8,9, }.
5+
* ASN.1 NUMERIC-STRING object.
6+
* <p>
7+
* This is an ASCII string of characters {0,1,2,3,4,5,6,7,8,9} + space.
8+
* <p>
9+
* See X.680 section 37.2.
10+
* <p>
11+
* Explicit character set escape sequences are not allowed.
12+
*/
13+
public class DERNumericString
14+
extends ASN1NumericString
15+
{
16+
/**
17+
* Basic constructor - without validation..
18+
*/
19+
public DERNumericString(String string)
20+
{
21+
this(string, false);
22+
}
23+
24+
/**
25+
* Constructor with optional validation.
26+
*
27+
* @param string the base string to wrap.
28+
* @param validate whether or not to check the string.
29+
* @throws IllegalArgumentException if validate is true and the string
30+
* contains characters that should not be in a NumericString.
31+
*/
32+
public DERNumericString(String string, boolean validate)
33+
{
34+
super(string, validate);
35+
}
36+
37+
DERNumericString(byte[] contents, boolean clone)
38+
{
39+
super(contents, clone);
40+
}
41+
}

0 commit comments

Comments
 (0)