1 diff -Naur bcpkix-jdk15on-149.orig/org/bouncycastle/cms/CMSSignedData.java bcpkix-jdk15on-149/org/bouncycastle/cms/CMSSignedData.java 2 --- bcpkix-jdk15on-149.orig/org/bouncycastle/cms/CMSSignedData.java 2013-05-31 21:17:22.000000000 +0000 3 +++ bcpkix-jdk15on-149/org/bouncycastle/cms/CMSSignedData.java 2013-05-25 02:14:15.000000000 +0000 4 @@ -25,7 +25,9 @@ 5 import org.bouncycastle.asn1.cms.ContentInfo; 6 import org.bouncycastle.asn1.cms.SignedData; 7 import org.bouncycastle.asn1.cms.SignerInfo; 8 -import org.bouncycastle.cert.jcajce.JcaCertStoreBuilder; 9 +// BEGIN android-removed 10 +// import org.bouncycastle.cert.jcajce.JcaCertStoreBuilder; 11 +// END android-removed 12 import org.bouncycastle.operator.DefaultSignatureAlgorithmIdentifierFinder; 13 import org.bouncycastle.operator.OperatorCreationException; 14 import org.bouncycastle.operator.SignatureAlgorithmIdentifierFinder; 15 @@ -309,147 +311,149 @@ 16 return attributeStore; 17 } 18 19 - /** 20 - * return a X509Store containing the public key certificates, if any, contained 21 - * in this message. 22 - * 23 - * @param type type of store to create 24 - * @param provider name of provider to use 25 - * @return a store of public key certificates 26 - * @exception NoSuchProviderException if the provider requested isn't available. 27 - * @exception NoSuchStoreException if the store type isn't available. 28 - * @exception CMSException if a general exception prevents creation of the X509Store 29 - * @deprecated use base Store returning method 30 - */ 31 - public X509Store getCertificates( 32 - String type, 33 - String provider) 34 - throws NoSuchStoreException, NoSuchProviderException, CMSException 35 - { 36 - return getCertificates(type, CMSUtils.getProvider(provider)); 37 - } 38 - 39 - /** 40 - * return a X509Store containing the public key certificates, if any, contained 41 - * in this message. 42 - * 43 - * @param type type of store to create 44 - * @param provider provider to use 45 - * @return a store of public key certificates 46 - * @exception NoSuchStoreException if the store type isn't available. 47 - * @exception CMSException if a general exception prevents creation of the X509Store 48 - * @deprecated use base Store returning method 49 - */ 50 - public X509Store getCertificates( 51 - String type, 52 - Provider provider) 53 - throws NoSuchStoreException, CMSException 54 - { 55 - if (certificateStore == null) 56 - { 57 - certificateStore = HELPER.createCertificateStore(type, provider, this.getCertificates()); 58 - } 59 - 60 - return certificateStore; 61 - } 62 - 63 - /** 64 - * return a X509Store containing CRLs, if any, contained 65 - * in this message. 66 - * 67 - * @param type type of store to create 68 - * @param provider name of provider to use 69 - * @return a store of CRLs 70 - * @exception NoSuchProviderException if the provider requested isn't available. 71 - * @exception NoSuchStoreException if the store type isn't available. 72 - * @exception CMSException if a general exception prevents creation of the X509Store 73 - * @deprecated use base Store returning method 74 - */ 75 - public X509Store getCRLs( 76 - String type, 77 - String provider) 78 - throws NoSuchStoreException, NoSuchProviderException, CMSException 79 - { 80 - return getCRLs(type, CMSUtils.getProvider(provider)); 81 - } 82 - 83 - /** 84 - * return a X509Store containing CRLs, if any, contained 85 - * in this message. 86 - * 87 - * @param type type of store to create 88 - * @param provider provider to use 89 - * @return a store of CRLs 90 - * @exception NoSuchStoreException if the store type isn't available. 91 - * @exception CMSException if a general exception prevents creation of the X509Store 92 - * @deprecated use base Store returning method 93 - */ 94 - public X509Store getCRLs( 95 - String type, 96 - Provider provider) 97 - throws NoSuchStoreException, CMSException 98 - { 99 - if (crlStore == null) 100 - { 101 - crlStore = HELPER.createCRLsStore(type, provider, getCRLs()); 102 - } 103 - 104 - return crlStore; 105 - } 106 - 107 - /** 108 - * return a CertStore containing the certificates and CRLs associated with 109 - * this message. 110 - * 111 - * @exception NoSuchProviderException if the provider requested isn't available. 112 - * @exception NoSuchAlgorithmException if the cert store isn't available. 113 - * @exception CMSException if a general exception prevents creation of the CertStore 114 - * @deprecated use base Store returning method and org.bouncycastle.cert.jcajce.JcaCertStoreBuilder 115 - */ 116 - public CertStore getCertificatesAndCRLs( 117 - String type, 118 - String provider) 119 - throws NoSuchAlgorithmException, NoSuchProviderException, CMSException 120 - { 121 - return getCertificatesAndCRLs(type, CMSUtils.getProvider(provider)); 122 - } 123 - 124 - /** 125 - * return a CertStore containing the certificates and CRLs associated with 126 - * this message. 127 - * 128 - * @exception NoSuchAlgorithmException if the cert store isn't available. 129 - * @exception CMSException if a general exception prevents creation of the CertStore 130 - * @deprecated use base Store returning method and org.bouncycastle.cert.jcajce.JcaCertStoreBuilder 131 - */ 132 - public CertStore getCertificatesAndCRLs( 133 - String type, 134 - Provider provider) 135 - throws NoSuchAlgorithmException, CMSException 136 - { 137 - try 138 - { 139 - JcaCertStoreBuilder certStoreBuilder = new JcaCertStoreBuilder().setType(type); 140 - 141 - if (provider != null) 142 - { 143 - certStoreBuilder.setProvider(provider); 144 - } 145 - 146 - certStoreBuilder.addCertificates(this.getCertificates()); 147 - certStoreBuilder.addCRLs(this.getCRLs()); 148 - 149 - return certStoreBuilder.build(); 150 - } 151 - catch (NoSuchAlgorithmException e) 152 - { 153 - throw e; 154 - } 155 - catch (Exception e) 156 - { 157 - throw new CMSException("exception creating CertStore: " + e.getMessage(), e); 158 - } 159 - } 160 + // BEGIN android-removed 161 + // /** 162 + // * return a X509Store containing the public key certificates, if any, contained 163 + // * in this message. 164 + // * 165 + // * @param type type of store to create 166 + // * @param provider name of provider to use 167 + // * @return a store of public key certificates 168 + // * @exception NoSuchProviderException if the provider requested isn't available. 169 + // * @exception NoSuchStoreException if the store type isn't available. 170 + // * @exception CMSException if a general exception prevents creation of the X509Store 171 + // * @deprecated use base Store returning method 172 + // */ 173 + // public X509Store getCertificates( 174 + // String type, 175 + // String provider) 176 + // throws NoSuchStoreException, NoSuchProviderException, CMSException 177 + // { 178 + // return getCertificates(type, CMSUtils.getProvider(provider)); 179 + // } 180 + // 181 + // /** 182 + // * return a X509Store containing the public key certificates, if any, contained 183 + // * in this message. 184 + // * 185 + // * @param type type of store to create 186 + // * @param provider provider to use 187 + // * @return a store of public key certificates 188 + // * @exception NoSuchStoreException if the store type isn't available. 189 + // * @exception CMSException if a general exception prevents creation of the X509Store 190 + // * @deprecated use base Store returning method 191 + // */ 192 + // public X509Store getCertificates( 193 + // String type, 194 + // Provider provider) 195 + // throws NoSuchStoreException, CMSException 196 + // { 197 + // if (certificateStore == null) 198 + // { 199 + // certificateStore = HELPER.createCertificateStore(type, provider, this.getCertificates()); 200 + // } 201 + // 202 + // return certificateStore; 203 + // } 204 + // 205 + // /** 206 + // * return a X509Store containing CRLs, if any, contained 207 + // * in this message. 208 + // * 209 + // * @param type type of store to create 210 + // * @param provider name of provider to use 211 + // * @return a store of CRLs 212 + // * @exception NoSuchProviderException if the provider requested isn't available. 213 + // * @exception NoSuchStoreException if the store type isn't available. 214 + // * @exception CMSException if a general exception prevents creation of the X509Store 215 + // * @deprecated use base Store returning method 216 + // */ 217 + // public X509Store getCRLs( 218 + // String type, 219 + // String provider) 220 + // throws NoSuchStoreException, NoSuchProviderException, CMSException 221 + // { 222 + // return getCRLs(type, CMSUtils.getProvider(provider)); 223 + // } 224 + // 225 + // /** 226 + // * return a X509Store containing CRLs, if any, contained 227 + // * in this message. 228 + // * 229 + // * @param type type of store to create 230 + // * @param provider provider to use 231 + // * @return a store of CRLs 232 + // * @exception NoSuchStoreException if the store type isn't available. 233 + // * @exception CMSException if a general exception prevents creation of the X509Store 234 + // * @deprecated use base Store returning method 235 + // */ 236 + // public X509Store getCRLs( 237 + // String type, 238 + // Provider provider) 239 + // throws NoSuchStoreException, CMSException 240 + // { 241 + // if (crlStore == null) 242 + // { 243 + // crlStore = HELPER.createCRLsStore(type, provider, getCRLs()); 244 + // } 245 + // 246 + // return crlStore; 247 + // } 248 + // 249 + // /** 250 + // * return a CertStore containing the certificates and CRLs associated with 251 + // * this message. 252 + // * 253 + // * @exception NoSuchProviderException if the provider requested isn't available. 254 + // * @exception NoSuchAlgorithmException if the cert store isn't available. 255 + // * @exception CMSException if a general exception prevents creation of the CertStore 256 + // * @deprecated use base Store returning method and org.bouncycastle.cert.jcajce.JcaCertStoreBuilder 257 + // */ 258 + // public CertStore getCertificatesAndCRLs( 259 + // String type, 260 + // String provider) 261 + // throws NoSuchAlgorithmException, NoSuchProviderException, CMSException 262 + // { 263 + // return getCertificatesAndCRLs(type, CMSUtils.getProvider(provider)); 264 + // } 265 + // 266 + // /** 267 + // * return a CertStore containing the certificates and CRLs associated with 268 + // * this message. 269 + // * 270 + // * @exception NoSuchAlgorithmException if the cert store isn't available. 271 + // * @exception CMSException if a general exception prevents creation of the CertStore 272 + // * @deprecated use base Store returning method and org.bouncycastle.cert.jcajce.JcaCertStoreBuilder 273 + // */ 274 + // public CertStore getCertificatesAndCRLs( 275 + // String type, 276 + // Provider provider) 277 + // throws NoSuchAlgorithmException, CMSException 278 + // { 279 + // try 280 + // { 281 + // JcaCertStoreBuilder certStoreBuilder = new JcaCertStoreBuilder().setType(type); 282 + // 283 + // if (provider != null) 284 + // { 285 + // certStoreBuilder.setProvider(provider); 286 + // } 287 + // 288 + // certStoreBuilder.addCertificates(this.getCertificates()); 289 + // certStoreBuilder.addCRLs(this.getCRLs()); 290 + // 291 + // return certStoreBuilder.build(); 292 + // } 293 + // catch (NoSuchAlgorithmException e) 294 + // { 295 + // throw e; 296 + // } 297 + // catch (Exception e) 298 + // { 299 + // throw new CMSException("exception creating CertStore: " + e.getMessage(), e); 300 + // } 301 + // } 302 + // END android-removed 303 304 /** 305 * Return any X.509 certificate objects in this SignedData structure as a Store of X509CertificateHolder objects. 306 @@ -481,18 +485,20 @@ 307 return HELPER.getAttributeCertificates(signedData.getCertificates()); 308 } 309 310 - /** 311 - * Return any OtherRevocationInfo OtherRevInfo objects of the type indicated by otherRevocationInfoFormat in 312 - * this SignedData structure. 313 - * 314 - * @param otherRevocationInfoFormat OID of the format type been looked for. 315 - * 316 - * @return a Store of ASN1Encodable objects representing any objects of otherRevocationInfoFormat found. 317 - */ 318 - public Store getOtherRevocationInfo(ASN1ObjectIdentifier otherRevocationInfoFormat) 319 - { 320 - return HELPER.getOtherRevocationInfo(otherRevocationInfoFormat, signedData.getCRLs()); 321 - } 322 + // BEGIN android-removed 323 + // /** 324 + // * Return any OtherRevocationInfo OtherRevInfo objects of the type indicated by otherRevocationInfoFormat in 325 + // * this SignedData structure. 326 + // * 327 + // * @param otherRevocationInfoFormat OID of the format type been looked for. 328 + // * 329 + // * @return a Store of ASN1Encodable objects representing any objects of otherRevocationInfoFormat found. 330 + // */ 331 + // public Store getOtherRevocationInfo(ASN1ObjectIdentifier otherRevocationInfoFormat) 332 + // { 333 + // return HELPER.getOtherRevocationInfo(otherRevocationInfoFormat, signedData.getCRLs()); 334 + // } 335 + // END android-removed 336 337 /** 338 * Return the a string representation of the OID associated with the 339 @@ -536,71 +542,73 @@ 340 return contentInfo.getEncoded(); 341 } 342 343 - /** 344 - * Verify all the SignerInformation objects and their associated counter signatures attached 345 - * to this CMS SignedData object. 346 - * 347 - * @param verifierProvider a provider of SignerInformationVerifier objects. 348 - * @return true if all verify, false otherwise. 349 - * @throws CMSException if an exception occurs during the verification process. 350 - */ 351 - public boolean verifySignatures(SignerInformationVerifierProvider verifierProvider) 352 - throws CMSException 353 - { 354 - return verifySignatures(verifierProvider, false); 355 - } 356 - 357 - /** 358 - * Verify all the SignerInformation objects and optionally their associated counter signatures attached 359 - * to this CMS SignedData object. 360 - * 361 - * @param verifierProvider a provider of SignerInformationVerifier objects. 362 - * @param ignoreCounterSignatures if true don't check counter signatures. If false check counter signatures as well. 363 - * @return true if all verify, false otherwise. 364 - * @throws CMSException if an exception occurs during the verification process. 365 - */ 366 - public boolean verifySignatures(SignerInformationVerifierProvider verifierProvider, boolean ignoreCounterSignatures) 367 - throws CMSException 368 - { 369 - Collection signers = this.getSignerInfos().getSigners(); 370 - 371 - for (Iterator it = signers.iterator(); it.hasNext();) 372 - { 373 - SignerInformation signer = (SignerInformation)it.next(); 374 - 375 - try 376 - { 377 - SignerInformationVerifier verifier = verifierProvider.get(signer.getSID()); 378 - 379 - if (!signer.verify(verifier)) 380 - { 381 - return false; 382 - } 383 - 384 - if (!ignoreCounterSignatures) 385 - { 386 - Collection counterSigners = signer.getCounterSignatures().getSigners(); 387 - 388 - for (Iterator cIt = counterSigners.iterator(); cIt.hasNext();) 389 - { 390 - SignerInformation counterSigner = (SignerInformation)cIt.next(); 391 - SignerInformationVerifier counterVerifier = verifierProvider.get(signer.getSID()); 392 - 393 - if (!counterSigner.verify(counterVerifier)) 394 - { 395 - return false; 396 - } 397 - } 398 - } 399 - } 400 - catch (OperatorCreationException e) 401 - { 402 - throw new CMSException("failure in verifier provider: " + e.getMessage(), e); 403 - } 404 - } 405 - 406 - return true; 407 - } 408 + // BEGIN android-removed 409 + // /** 410 + // * Verify all the SignerInformation objects and their associated counter signatures attached 411 + // * to this CMS SignedData object. 412 + // * 413 + // * @param verifierProvider a provider of SignerInformationVerifier objects. 414 + // * @return true if all verify, false otherwise. 415 + // * @throws CMSException if an exception occurs during the verification process. 416 + // */ 417 + // public boolean verifySignatures(SignerInformationVerifierProvider verifierProvider) 418 + // throws CMSException 419 + // { 420 + // return verifySignatures(verifierProvider, false); 421 + // } 422 + // 423 + // /** 424 + // * Verify all the SignerInformation objects and optionally their associated counter signatures attached 425 + // * to this CMS SignedData object. 426 + // * 427 + // * @param verifierProvider a provider of SignerInformationVerifier objects. 428 + // * @param ignoreCounterSignatures if true don't check counter signatures. If false check counter signatures as well. 429 + // * @return true if all verify, false otherwise. 430 + // * @throws CMSException if an exception occurs during the verification process. 431 + // */ 432 + // public boolean verifySignatures(SignerInformationVerifierProvider verifierProvider, boolean ignoreCounterSignatures) 433 + // throws CMSException 434 + // { 435 + // Collection signers = this.getSignerInfos().getSigners(); 436 + // 437 + // for (Iterator it = signers.iterator(); it.hasNext();) 438 + // { 439 + // SignerInformation signer = (SignerInformation)it.next(); 440 + // 441 + // try 442 + // { 443 + // SignerInformationVerifier verifier = verifierProvider.get(signer.getSID()); 444 + // 445 + // if (!signer.verify(verifier)) 446 + // { 447 + // return false; 448 + // } 449 + // 450 + // if (!ignoreCounterSignatures) 451 + // { 452 + // Collection counterSigners = signer.getCounterSignatures().getSigners(); 453 + // 454 + // for (Iterator cIt = counterSigners.iterator(); cIt.hasNext();) 455 + // { 456 + // SignerInformation counterSigner = (SignerInformation)cIt.next(); 457 + // SignerInformationVerifier counterVerifier = verifierProvider.get(signer.getSID()); 458 + // 459 + // if (!counterSigner.verify(counterVerifier)) 460 + // { 461 + // return false; 462 + // } 463 + // } 464 + // } 465 + // } 466 + // catch (OperatorCreationException e) 467 + // { 468 + // throw new CMSException("failure in verifier provider: " + e.getMessage(), e); 469 + // } 470 + // } 471 + // 472 + // return true; 473 + // } 474 + // END android-removed 475 476 /** 477 * Replace the SignerInformation store associated with this 478 diff -Naur bcpkix-jdk15on-149.orig/org/bouncycastle/cms/CMSSignedGenerator.java bcpkix-jdk15on-149/org/bouncycastle/cms/CMSSignedGenerator.java 479 --- bcpkix-jdk15on-149.orig/org/bouncycastle/cms/CMSSignedGenerator.java 2013-05-31 21:17:22.000000000 +0000 480 +++ bcpkix-jdk15on-149/org/bouncycastle/cms/CMSSignedGenerator.java 2013-05-25 02:14:15.000000000 +0000 481 @@ -23,8 +23,10 @@ 482 import org.bouncycastle.asn1.DERTaggedObject; 483 import org.bouncycastle.asn1.cms.AttributeTable; 484 import org.bouncycastle.asn1.cms.CMSObjectIdentifiers; 485 -import org.bouncycastle.asn1.cms.OtherRevocationInfoFormat; 486 -import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers; 487 +// BEGIN android-removed 488 +// import org.bouncycastle.asn1.cms.OtherRevocationInfoFormat; 489 +// import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers; 490 +// END android-removed 491 import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; 492 import org.bouncycastle.asn1.oiw.OIWObjectIdentifiers; 493 import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers; 494 @@ -35,7 +37,9 @@ 495 import org.bouncycastle.cert.X509AttributeCertificateHolder; 496 import org.bouncycastle.cert.X509CRLHolder; 497 import org.bouncycastle.cert.X509CertificateHolder; 498 -import org.bouncycastle.jce.interfaces.GOST3410PrivateKey; 499 +// BEGIN android-removed 500 +// import org.bouncycastle.jce.interfaces.GOST3410PrivateKey; 501 +// END android-removed 502 import org.bouncycastle.util.Arrays; 503 import org.bouncycastle.util.Store; 504 import org.bouncycastle.x509.X509AttributeCertificate; 505 @@ -49,25 +53,33 @@ 506 public static final String DATA = CMSObjectIdentifiers.data.getId(); 507 508 public static final String DIGEST_SHA1 = OIWObjectIdentifiers.idSHA1.getId(); 509 - public static final String DIGEST_SHA224 = NISTObjectIdentifiers.id_sha224.getId(); 510 + // BEGIN android-removed 511 + // public static final String DIGEST_SHA224 = NISTObjectIdentifiers.id_sha224.getId(); 512 + // END android-removed 513 public static final String DIGEST_SHA256 = NISTObjectIdentifiers.id_sha256.getId(); 514 public static final String DIGEST_SHA384 = NISTObjectIdentifiers.id_sha384.getId(); 515 public static final String DIGEST_SHA512 = NISTObjectIdentifiers.id_sha512.getId(); 516 public static final String DIGEST_MD5 = PKCSObjectIdentifiers.md5.getId(); 517 - public static final String DIGEST_GOST3411 = CryptoProObjectIdentifiers.gostR3411.getId(); 518 - public static final String DIGEST_RIPEMD128 = TeleTrusTObjectIdentifiers.ripemd128.getId(); 519 - public static final String DIGEST_RIPEMD160 = TeleTrusTObjectIdentifiers.ripemd160.getId(); 520 - public static final String DIGEST_RIPEMD256 = TeleTrusTObjectIdentifiers.ripemd256.getId(); 521 + // BEGIN android-removed 522 + // public static final String DIGEST_GOST3411 = CryptoProObjectIdentifiers.gostR3411.getId(); 523 + // public static final String DIGEST_RIPEMD128 = TeleTrusTObjectIdentifiers.ripemd128.getId(); 524 + // public static final String DIGEST_RIPEMD160 = TeleTrusTObjectIdentifiers.ripemd160.getId(); 525 + // public static final String DIGEST_RIPEMD256 = TeleTrusTObjectIdentifiers.ripemd256.getId(); 526 + // END android-removed 527 528 public static final String ENCRYPTION_RSA = PKCSObjectIdentifiers.rsaEncryption.getId(); 529 public static final String ENCRYPTION_DSA = X9ObjectIdentifiers.id_dsa_with_sha1.getId(); 530 public static final String ENCRYPTION_ECDSA = X9ObjectIdentifiers.ecdsa_with_SHA1.getId(); 531 public static final String ENCRYPTION_RSA_PSS = PKCSObjectIdentifiers.id_RSASSA_PSS.getId(); 532 - public static final String ENCRYPTION_GOST3410 = CryptoProObjectIdentifiers.gostR3410_94.getId(); 533 - public static final String ENCRYPTION_ECGOST3410 = CryptoProObjectIdentifiers.gostR3410_2001.getId(); 534 + // BEGIN android-removed 535 + // public static final String ENCRYPTION_GOST3410 = CryptoProObjectIdentifiers.gostR3410_94.getId(); 536 + // public static final String ENCRYPTION_ECGOST3410 = CryptoProObjectIdentifiers.gostR3410_2001.getId(); 537 + // END android-removed 538 539 private static final String ENCRYPTION_ECDSA_WITH_SHA1 = X9ObjectIdentifiers.ecdsa_with_SHA1.getId(); 540 - private static final String ENCRYPTION_ECDSA_WITH_SHA224 = X9ObjectIdentifiers.ecdsa_with_SHA224.getId(); 541 + // BEGIN android-removed 542 + // private static final String ENCRYPTION_ECDSA_WITH_SHA224 = X9ObjectIdentifiers.ecdsa_with_SHA224.getId(); 543 + // END android-removed 544 private static final String ENCRYPTION_ECDSA_WITH_SHA256 = X9ObjectIdentifiers.ecdsa_with_SHA256.getId(); 545 private static final String ENCRYPTION_ECDSA_WITH_SHA384 = X9ObjectIdentifiers.ecdsa_with_SHA384.getId(); 546 private static final String ENCRYPTION_ECDSA_WITH_SHA512 = X9ObjectIdentifiers.ecdsa_with_SHA512.getId(); 547 @@ -80,13 +92,17 @@ 548 NO_PARAMS.add(ENCRYPTION_DSA); 549 NO_PARAMS.add(ENCRYPTION_ECDSA); 550 NO_PARAMS.add(ENCRYPTION_ECDSA_WITH_SHA1); 551 - NO_PARAMS.add(ENCRYPTION_ECDSA_WITH_SHA224); 552 + // BEGIN android-removed 553 + // NO_PARAMS.add(ENCRYPTION_ECDSA_WITH_SHA224); 554 + // END android-removed 555 NO_PARAMS.add(ENCRYPTION_ECDSA_WITH_SHA256); 556 NO_PARAMS.add(ENCRYPTION_ECDSA_WITH_SHA384); 557 NO_PARAMS.add(ENCRYPTION_ECDSA_WITH_SHA512); 558 559 EC_ALGORITHMS.put(DIGEST_SHA1, ENCRYPTION_ECDSA_WITH_SHA1); 560 - EC_ALGORITHMS.put(DIGEST_SHA224, ENCRYPTION_ECDSA_WITH_SHA224); 561 + // BEGIN android-removed 562 + // EC_ALGORITHMS.put(DIGEST_SHA224, ENCRYPTION_ECDSA_WITH_SHA224); 563 + // END android-removed 564 EC_ALGORITHMS.put(DIGEST_SHA256, ENCRYPTION_ECDSA_WITH_SHA256); 565 EC_ALGORITHMS.put(DIGEST_SHA384, ENCRYPTION_ECDSA_WITH_SHA384); 566 EC_ALGORITHMS.put(DIGEST_SHA512, ENCRYPTION_ECDSA_WITH_SHA512); 567 @@ -144,14 +160,16 @@ 568 throw new IllegalArgumentException("can't mix ECDSA with anything but SHA family digests"); 569 } 570 } 571 - else if (key instanceof GOST3410PrivateKey || "GOST3410".equalsIgnoreCase(key.getAlgorithm())) 572 - { 573 - encOID = ENCRYPTION_GOST3410; 574 - } 575 - else if ("ECGOST3410".equalsIgnoreCase(key.getAlgorithm())) 576 - { 577 - encOID = ENCRYPTION_ECGOST3410; 578 - } 579 + // BEGIN android-removed 580 + // else if (key instanceof GOST3410PrivateKey || "GOST3410".equalsIgnoreCase(key.getAlgorithm())) 581 + // { 582 + // encOID = ENCRYPTION_GOST3410; 583 + // } 584 + // else if ("ECGOST3410".equalsIgnoreCase(key.getAlgorithm())) 585 + // { 586 + // encOID = ENCRYPTION_ECGOST3410; 587 + // } 588 + // END android-removed 589 590 return encOID; 591 } 592 @@ -270,31 +288,33 @@ 593 certs.addAll(CMSUtils.getAttributeCertificatesFromStore(attrStore)); 594 } 595 596 - /** 597 - * Add a single instance of otherRevocationData to the CRL set to be included with the generated SignedData message. 598 - * 599 - * @param otherRevocationInfoFormat the OID specifying the format of the otherRevocationInfo data. 600 - * @param otherRevocationInfo the otherRevocationInfo ASN.1 structure. 601 - */ 602 - public void addOtherRevocationInfo( 603 - ASN1ObjectIdentifier otherRevocationInfoFormat, 604 - ASN1Encodable otherRevocationInfo) 605 - { 606 - crls.add(new DERTaggedObject(false, 1, new OtherRevocationInfoFormat(otherRevocationInfoFormat, otherRevocationInfo))); 607 - } 608 - 609 - /** 610 - * Add a Store of otherRevocationData to the CRL set to be included with the generated SignedData message. 611 - * 612 - * @param otherRevocationInfoFormat the OID specifying the format of the otherRevocationInfo data. 613 - * @param otherRevocationInfos a Store of otherRevocationInfo data to add. 614 - */ 615 - public void addOtherRevocationInfo( 616 - ASN1ObjectIdentifier otherRevocationInfoFormat, 617 - Store otherRevocationInfos) 618 - { 619 - crls.addAll(CMSUtils.getOthersFromStore(otherRevocationInfoFormat, otherRevocationInfos)); 620 - } 621 + // BEGIN android-removed 622 + // /** 623 + // * Add a single instance of otherRevocationData to the CRL set to be included with the generated SignedData message. 624 + // * 625 + // * @param otherRevocationInfoFormat the OID specifying the format of the otherRevocationInfo data. 626 + // * @param otherRevocationInfo the otherRevocationInfo ASN.1 structure. 627 + // */ 628 + // public void addOtherRevocationInfo( 629 + // ASN1ObjectIdentifier otherRevocationInfoFormat, 630 + // ASN1Encodable otherRevocationInfo) 631 + // { 632 + // crls.add(new DERTaggedObject(false, 1, new OtherRevocationInfoFormat(otherRevocationInfoFormat, otherRevocationInfo))); 633 + // } 634 + // 635 + // /** 636 + // * Add a Store of otherRevocationData to the CRL set to be included with the generated SignedData message. 637 + // * 638 + // * @param otherRevocationInfoFormat the OID specifying the format of the otherRevocationInfo data. 639 + // * @param otherRevocationInfos a Store of otherRevocationInfo data to add. 640 + // */ 641 + // public void addOtherRevocationInfo( 642 + // ASN1ObjectIdentifier otherRevocationInfoFormat, 643 + // Store otherRevocationInfos) 644 + // { 645 + // crls.addAll(CMSUtils.getOthersFromStore(otherRevocationInfoFormat, otherRevocationInfos)); 646 + // } 647 + // END android-removed 648 649 /** 650 * Add the attribute certificates contained in the passed in store to the 651 diff -Naur bcpkix-jdk15on-149.orig/org/bouncycastle/cms/CMSSignedHelper.java bcpkix-jdk15on-149/org/bouncycastle/cms/CMSSignedHelper.java 652 --- bcpkix-jdk15on-149.orig/org/bouncycastle/cms/CMSSignedHelper.java 2013-05-31 21:17:22.000000000 +0000 653 +++ bcpkix-jdk15on-149/org/bouncycastle/cms/CMSSignedHelper.java 2013-05-25 02:14:15.000000000 +0000 654 @@ -19,8 +19,10 @@ 655 import org.bouncycastle.asn1.ASN1Set; 656 import org.bouncycastle.asn1.ASN1TaggedObject; 657 import org.bouncycastle.asn1.DERNull; 658 -import org.bouncycastle.asn1.cms.OtherRevocationInfoFormat; 659 -import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers; 660 +// BEGIN android-removed 661 +// import org.bouncycastle.asn1.cms.OtherRevocationInfoFormat; 662 +// import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers; 663 +// END android-removed 664 import org.bouncycastle.asn1.eac.EACObjectIdentifiers; 665 import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; 666 import org.bouncycastle.asn1.oiw.OIWObjectIdentifiers; 667 @@ -35,8 +37,10 @@ 668 import org.bouncycastle.cert.X509AttributeCertificateHolder; 669 import org.bouncycastle.cert.X509CRLHolder; 670 import org.bouncycastle.cert.X509CertificateHolder; 671 -import org.bouncycastle.cert.jcajce.JcaX509CRLConverter; 672 -import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; 673 +// BEGIN android-removed 674 +// import org.bouncycastle.cert.jcajce.JcaX509CRLConverter; 675 +// import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; 676 +// END android-removed 677 import org.bouncycastle.util.CollectionStore; 678 import org.bouncycastle.util.Store; 679 import org.bouncycastle.x509.NoSuchStoreException; 680 @@ -60,31 +64,43 @@ 681 682 static 683 { 684 - addEntries(NISTObjectIdentifiers.dsa_with_sha224, "SHA224", "DSA"); 685 + // BEGIN android-removed 686 + // addEntries(NISTObjectIdentifiers.dsa_with_sha224, "SHA224", "DSA"); 687 + // END android-removed 688 addEntries(NISTObjectIdentifiers.dsa_with_sha256, "SHA256", "DSA"); 689 addEntries(NISTObjectIdentifiers.dsa_with_sha384, "SHA384", "DSA"); 690 addEntries(NISTObjectIdentifiers.dsa_with_sha512, "SHA512", "DSA"); 691 addEntries(OIWObjectIdentifiers.dsaWithSHA1, "SHA1", "DSA"); 692 - addEntries(OIWObjectIdentifiers.md4WithRSA, "MD4", "RSA"); 693 - addEntries(OIWObjectIdentifiers.md4WithRSAEncryption, "MD4", "RSA"); 694 + // BEGIN android-removed 695 + // addEntries(OIWObjectIdentifiers.md4WithRSA, "MD4", "RSA"); 696 + // addEntries(OIWObjectIdentifiers.md4WithRSAEncryption, "MD4", "RSA"); 697 + // END android-removed 698 addEntries(OIWObjectIdentifiers.md5WithRSA, "MD5", "RSA"); 699 addEntries(OIWObjectIdentifiers.sha1WithRSA, "SHA1", "RSA"); 700 - addEntries(PKCSObjectIdentifiers.md2WithRSAEncryption, "MD2", "RSA"); 701 - addEntries(PKCSObjectIdentifiers.md4WithRSAEncryption, "MD4", "RSA"); 702 + // BEGIN android-removed 703 + // addEntries(PKCSObjectIdentifiers.md2WithRSAEncryption, "MD2", "RSA"); 704 + // addEntries(PKCSObjectIdentifiers.md4WithRSAEncryption, "MD4", "RSA"); 705 + // END android-removed 706 addEntries(PKCSObjectIdentifiers.md5WithRSAEncryption, "MD5", "RSA"); 707 addEntries(PKCSObjectIdentifiers.sha1WithRSAEncryption, "SHA1", "RSA"); 708 - addEntries(PKCSObjectIdentifiers.sha224WithRSAEncryption, "SHA224", "RSA"); 709 + // BEGIN android-removed 710 + // addEntries(PKCSObjectIdentifiers.sha224WithRSAEncryption, "SHA224", "RSA"); 711 + // END android-removed 712 addEntries(PKCSObjectIdentifiers.sha256WithRSAEncryption, "SHA256", "RSA"); 713 addEntries(PKCSObjectIdentifiers.sha384WithRSAEncryption, "SHA384", "RSA"); 714 addEntries(PKCSObjectIdentifiers.sha512WithRSAEncryption, "SHA512", "RSA"); 715 addEntries(X9ObjectIdentifiers.ecdsa_with_SHA1, "SHA1", "ECDSA"); 716 - addEntries(X9ObjectIdentifiers.ecdsa_with_SHA224, "SHA224", "ECDSA"); 717 + // BEGIN android-removed 718 + // addEntries(X9ObjectIdentifiers.ecdsa_with_SHA224, "SHA224", "ECDSA"); 719 + // END android-removed 720 addEntries(X9ObjectIdentifiers.ecdsa_with_SHA256, "SHA256", "ECDSA"); 721 addEntries(X9ObjectIdentifiers.ecdsa_with_SHA384, "SHA384", "ECDSA"); 722 addEntries(X9ObjectIdentifiers.ecdsa_with_SHA512, "SHA512", "ECDSA"); 723 addEntries(X9ObjectIdentifiers.id_dsa_with_sha1, "SHA1", "DSA"); 724 addEntries(EACObjectIdentifiers.id_TA_ECDSA_SHA_1, "SHA1", "ECDSA"); 725 - addEntries(EACObjectIdentifiers.id_TA_ECDSA_SHA_224, "SHA224", "ECDSA"); 726 + // BEGIN android-removed 727 + // addEntries(EACObjectIdentifiers.id_TA_ECDSA_SHA_224, "SHA224", "ECDSA"); 728 + // END android-removed 729 addEntries(EACObjectIdentifiers.id_TA_ECDSA_SHA_256, "SHA256", "ECDSA"); 730 addEntries(EACObjectIdentifiers.id_TA_ECDSA_SHA_384, "SHA384", "ECDSA"); 731 addEntries(EACObjectIdentifiers.id_TA_ECDSA_SHA_512, "SHA512", "ECDSA"); 732 @@ -97,30 +113,38 @@ 733 encryptionAlgs.put(PKCSObjectIdentifiers.rsaEncryption.getId(), "RSA"); 734 encryptionAlgs.put(TeleTrusTObjectIdentifiers.teleTrusTRSAsignatureAlgorithm, "RSA"); 735 encryptionAlgs.put(X509ObjectIdentifiers.id_ea_rsa.getId(), "RSA"); 736 - encryptionAlgs.put(CMSSignedDataGenerator.ENCRYPTION_RSA_PSS, "RSAandMGF1"); 737 - encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3410_94.getId(), "GOST3410"); 738 - encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3410_2001.getId(), "ECGOST3410"); 739 - encryptionAlgs.put("1.3.6.1.4.1.5849.1.6.2", "ECGOST3410"); 740 - encryptionAlgs.put("1.3.6.1.4.1.5849.1.1.5", "GOST3410"); 741 - encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001.getId(), "ECGOST3410"); 742 - encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94.getId(), "GOST3410"); 743 - 744 - digestAlgs.put(PKCSObjectIdentifiers.md2.getId(), "MD2"); 745 - digestAlgs.put(PKCSObjectIdentifiers.md4.getId(), "MD4"); 746 + // BEGIN android-removed 747 + // encryptionAlgs.put(CMSSignedDataGenerator.ENCRYPTION_RSA_PSS, "RSAandMGF1"); 748 + // encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3410_94.getId(), "GOST3410"); 749 + // encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3410_2001.getId(), "ECGOST3410"); 750 + // encryptionAlgs.put("1.3.6.1.4.1.5849.1.6.2", "ECGOST3410"); 751 + // encryptionAlgs.put("1.3.6.1.4.1.5849.1.1.5", "GOST3410"); 752 + // encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001.getId(), "ECGOST3410"); 753 + // encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94.getId(), "GOST3410"); 754 + // 755 + // digestAlgs.put(PKCSObjectIdentifiers.md2.getId(), "MD2"); 756 + // digestAlgs.put(PKCSObjectIdentifiers.md4.getId(), "MD4"); 757 + // END android-removed 758 digestAlgs.put(PKCSObjectIdentifiers.md5.getId(), "MD5"); 759 digestAlgs.put(OIWObjectIdentifiers.idSHA1.getId(), "SHA1"); 760 - digestAlgs.put(NISTObjectIdentifiers.id_sha224.getId(), "SHA224"); 761 + // BEGIN android-removed 762 + // digestAlgs.put(NISTObjectIdentifiers.id_sha224.getId(), "SHA224"); 763 + // END android-removed 764 digestAlgs.put(NISTObjectIdentifiers.id_sha256.getId(), "SHA256"); 765 digestAlgs.put(NISTObjectIdentifiers.id_sha384.getId(), "SHA384"); 766 digestAlgs.put(NISTObjectIdentifiers.id_sha512.getId(), "SHA512"); 767 - digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd128.getId(), "RIPEMD128"); 768 - digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd160.getId(), "RIPEMD160"); 769 - digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd256.getId(), "RIPEMD256"); 770 - digestAlgs.put(CryptoProObjectIdentifiers.gostR3411.getId(), "GOST3411"); 771 - digestAlgs.put("1.3.6.1.4.1.5849.1.2.1", "GOST3411"); 772 + // BEGIN android-removed 773 + // digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd128.getId(), "RIPEMD128"); 774 + // digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd160.getId(), "RIPEMD160"); 775 + // digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd256.getId(), "RIPEMD256"); 776 + // digestAlgs.put(CryptoProObjectIdentifiers.gostR3411.getId(), "GOST3411"); 777 + // digestAlgs.put("1.3.6.1.4.1.5849.1.2.1", "GOST3411"); 778 + // END android-removed 779 780 digestAliases.put("SHA1", new String[] { "SHA-1" }); 781 - digestAliases.put("SHA224", new String[] { "SHA-224" }); 782 + // BEGIN android-removed 783 + // digestAliases.put("SHA224", new String[] { "SHA-224" }); 784 + // END android-removed 785 digestAliases.put("SHA256", new String[] { "SHA-256" }); 786 digestAliases.put("SHA384", new String[] { "SHA-384" }); 787 digestAliases.put("SHA512", new String[] { "SHA-512" }); 788 @@ -190,65 +214,67 @@ 789 } 790 } 791 792 - X509Store createCertificateStore( 793 - String type, 794 - Provider provider, 795 - Store certStore) 796 - throws NoSuchStoreException, CMSException 797 - { 798 - try 799 - { 800 - JcaX509CertificateConverter converter = new JcaX509CertificateConverter().setProvider(provider); 801 - Collection certHldrs = certStore.getMatches(null); 802 - List certs = new ArrayList(certHldrs.size()); 803 - 804 - for (Iterator it = certHldrs.iterator(); it.hasNext();) 805 - { 806 - certs.add(converter.getCertificate((X509CertificateHolder)it.next())); 807 - } 808 - 809 - return X509Store.getInstance( 810 - "Certificate/" +type, new X509CollectionStoreParameters(certs), provider); 811 - } 812 - catch (IllegalArgumentException e) 813 - { 814 - throw new CMSException("can't setup the X509Store", e); 815 - } 816 - catch (CertificateException e) 817 - { 818 - throw new CMSException("can't setup the X509Store", e); 819 - } 820 - } 821 - 822 - X509Store createCRLsStore( 823 - String type, 824 - Provider provider, 825 - Store crlStore) 826 - throws NoSuchStoreException, CMSException 827 - { 828 - try 829 - { 830 - JcaX509CRLConverter converter = new JcaX509CRLConverter().setProvider(provider); 831 - Collection crlHldrs = crlStore.getMatches(null); 832 - List crls = new ArrayList(crlHldrs.size()); 833 - 834 - for (Iterator it = crlHldrs.iterator(); it.hasNext();) 835 - { 836 - crls.add(converter.getCRL((X509CRLHolder)it.next())); 837 - } 838 - 839 - return X509Store.getInstance( 840 - "CRL/" +type, new X509CollectionStoreParameters(crls), provider); 841 - } 842 - catch (IllegalArgumentException e) 843 - { 844 - throw new CMSException("can't setup the X509Store", e); 845 - } 846 - catch (CRLException e) 847 - { 848 - throw new CMSException("can't setup the X509Store", e); 849 - } 850 - } 851 + // BEGIN android-removed 852 + // X509Store createCertificateStore( 853 + // String type, 854 + // Provider provider, 855 + // Store certStore) 856 + // throws NoSuchStoreException, CMSException 857 + // { 858 + // try 859 + // { 860 + // JcaX509CertificateConverter converter = new JcaX509CertificateConverter().setProvider(provider); 861 + // Collection certHldrs = certStore.getMatches(null); 862 + // List certs = new ArrayList(certHldrs.size()); 863 + // 864 + // for (Iterator it = certHldrs.iterator(); it.hasNext();) 865 + // { 866 + // certs.add(converter.getCertificate((X509CertificateHolder)it.next())); 867 + // } 868 + // 869 + // return X509Store.getInstance( 870 + // "Certificate/" +type, new X509CollectionStoreParameters(certs), provider); 871 + // } 872 + // catch (IllegalArgumentException e) 873 + // { 874 + // throw new CMSException("can't setup the X509Store", e); 875 + // } 876 + // catch (CertificateException e) 877 + // { 878 + // throw new CMSException("can't setup the X509Store", e); 879 + // } 880 + // } 881 + // 882 + // X509Store createCRLsStore( 883 + // String type, 884 + // Provider provider, 885 + // Store crlStore) 886 + // throws NoSuchStoreException, CMSException 887 + // { 888 + // try 889 + // { 890 + // JcaX509CRLConverter converter = new JcaX509CRLConverter().setProvider(provider); 891 + // Collection crlHldrs = crlStore.getMatches(null); 892 + // List crls = new ArrayList(crlHldrs.size()); 893 + // 894 + // for (Iterator it = crlHldrs.iterator(); it.hasNext();) 895 + // { 896 + // crls.add(converter.getCRL((X509CRLHolder)it.next())); 897 + // } 898 + // 899 + // return X509Store.getInstance( 900 + // "CRL/" +type, new X509CollectionStoreParameters(crls), provider); 901 + // } 902 + // catch (IllegalArgumentException e) 903 + // { 904 + // throw new CMSException("can't setup the X509Store", e); 905 + // } 906 + // catch (CRLException e) 907 + // { 908 + // throw new CMSException("can't setup the X509Store", e); 909 + // } 910 + // } 911 + // END android-removed 912 913 AlgorithmIdentifier fixAlgID(AlgorithmIdentifier algId) 914 { 915 @@ -336,35 +362,35 @@ 916 return new CollectionStore(new ArrayList()); 917 } 918 919 - Store getOtherRevocationInfo(ASN1ObjectIdentifier otherRevocationInfoFormat, ASN1Set crlSet) 920 - { 921 - if (crlSet != null) 922 - { 923 - List crlList = new ArrayList(crlSet.size()); 924 - 925 - for (Enumeration en = crlSet.getObjects(); en.hasMoreElements();) 926 - { 927 - ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive(); 928 - 929 - if (obj instanceof ASN1TaggedObject) 930 - { 931 - ASN1TaggedObject tObj = ASN1TaggedObject.getInstance(obj); 932 - 933 - if (tObj.getTagNo() == 1) 934 - { 935 - OtherRevocationInfoFormat other = OtherRevocationInfoFormat.getInstance(tObj, false); 936 - 937 - if (otherRevocationInfoFormat.equals(other.getInfoFormat())) 938 - { 939 - crlList.add(other.getInfo()); 940 - } 941 - } 942 - } 943 - } 944 - 945 - return new CollectionStore(crlList); 946 - } 947 - 948 - return new CollectionStore(new ArrayList()); 949 - } 950 + // Store getOtherRevocationInfo(ASN1ObjectIdentifier otherRevocationInfoFormat, ASN1Set crlSet) 951 + // { 952 + // if (crlSet != null) 953 + // { 954 + // List crlList = new ArrayList(crlSet.size()); 955 + // 956 + // for (Enumeration en = crlSet.getObjects(); en.hasMoreElements();) 957 + // { 958 + // ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive(); 959 + // 960 + // if (obj instanceof ASN1TaggedObject) 961 + // { 962 + // ASN1TaggedObject tObj = ASN1TaggedObject.getInstance(obj); 963 + // 964 + // if (tObj.getTagNo() == 1) 965 + // { 966 + // OtherRevocationInfoFormat other = OtherRevocationInfoFormat.getInstance(tObj, false); 967 + // 968 + // if (otherRevocationInfoFormat.equals(other.getInfoFormat())) 969 + // { 970 + // crlList.add(other.getInfo()); 971 + // } 972 + // } 973 + // } 974 + // } 975 + // 976 + // return new CollectionStore(crlList); 977 + // } 978 + // 979 + // return new CollectionStore(new ArrayList()); 980 + // } 981 } 982 diff -Naur bcpkix-jdk15on-149.orig/org/bouncycastle/cms/CMSUtils.java bcpkix-jdk15on-149/org/bouncycastle/cms/CMSUtils.java 983 --- bcpkix-jdk15on-149.orig/org/bouncycastle/cms/CMSUtils.java 2013-05-31 21:17:22.000000000 +0000 984 +++ bcpkix-jdk15on-149/org/bouncycastle/cms/CMSUtils.java 2013-05-25 02:14:15.000000000 +0000 985 @@ -30,9 +30,11 @@ 986 import org.bouncycastle.asn1.cms.CMSObjectIdentifiers; 987 import org.bouncycastle.asn1.cms.ContentInfo; 988 import org.bouncycastle.asn1.cms.IssuerAndSerialNumber; 989 -import org.bouncycastle.asn1.cms.OtherRevocationInfoFormat; 990 -import org.bouncycastle.asn1.ocsp.OCSPResponse; 991 -import org.bouncycastle.asn1.ocsp.OCSPResponseStatus; 992 +// BEGIN android-removed 993 +// import org.bouncycastle.asn1.cms.OtherRevocationInfoFormat; 994 +// import org.bouncycastle.asn1.ocsp.OCSPResponse; 995 +// import org.bouncycastle.asn1.ocsp.OCSPResponseStatus; 996 +// END android-removed 997 import org.bouncycastle.asn1.x509.Certificate; 998 import org.bouncycastle.asn1.x509.CertificateList; 999 import org.bouncycastle.asn1.x509.TBSCertificate; 1000 @@ -189,29 +191,31 @@ 1001 } 1002 } 1003 1004 - static Collection getOthersFromStore(ASN1ObjectIdentifier otherRevocationInfoFormat, Store otherRevocationInfos) 1005 - { 1006 - List others = new ArrayList(); 1007 - 1008 - for (Iterator it = otherRevocationInfos.getMatches(null).iterator(); it.hasNext();) 1009 - { 1010 - ASN1Encodable info = (ASN1Encodable)it.next(); 1011 - 1012 - if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(otherRevocationInfoFormat)) 1013 - { 1014 - OCSPResponse resp = OCSPResponse.getInstance(info); 1015 - 1016 - if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL) 1017 - { 1018 - throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData"); 1019 - } 1020 - } 1021 - 1022 - others.add(new DERTaggedObject(false, 1, new OtherRevocationInfoFormat(otherRevocationInfoFormat, info))); 1023 - } 1024 - 1025 - return others; 1026 - } 1027 + // BEGIN android-removed 1028 + // static Collection getOthersFromStore(ASN1ObjectIdentifier otherRevocationInfoFormat, Store otherRevocationInfos) 1029 + // { 1030 + // List others = new ArrayList(); 1031 + // 1032 + // for (Iterator it = otherRevocationInfos.getMatches(null).iterator(); it.hasNext();) 1033 + // { 1034 + // ASN1Encodable info = (ASN1Encodable)it.next(); 1035 + // 1036 + // if (CMSObjectIdentifiers.id_ri_ocsp_response.equals(otherRevocationInfoFormat)) 1037 + // { 1038 + // OCSPResponse resp = OCSPResponse.getInstance(info); 1039 + // 1040 + // if (resp.getResponseStatus().getValue().intValue() != OCSPResponseStatus.SUCCESSFUL) 1041 + // { 1042 + // throw new IllegalArgumentException("cannot add unsuccessful OCSP response to CMS SignedData"); 1043 + // } 1044 + // } 1045 + // 1046 + // others.add(new DERTaggedObject(false, 1, new OtherRevocationInfoFormat(otherRevocationInfoFormat, info))); 1047 + // } 1048 + // 1049 + // return others; 1050 + // } 1051 + // END android-removed 1052 1053 static ASN1Set createBerSetFromList(List derObjects) 1054 { 1055 diff -Naur bcpkix-jdk15on-149.orig/org/bouncycastle/cms/DefaultCMSSignatureAlgorithmNameGenerator.java bcpkix-jdk15on-149/org/bouncycastle/cms/DefaultCMSSignatureAlgorithmNameGenerator.java 1056 --- bcpkix-jdk15on-149.orig/org/bouncycastle/cms/DefaultCMSSignatureAlgorithmNameGenerator.java 2013-05-31 21:17:22.000000000 +0000 1057 +++ bcpkix-jdk15on-149/org/bouncycastle/cms/DefaultCMSSignatureAlgorithmNameGenerator.java 2012-09-17 23:04:47.000000000 +0000 1058 @@ -4,7 +4,9 @@ 1059 import java.util.Map; 1060 1061 import org.bouncycastle.asn1.ASN1ObjectIdentifier; 1062 -import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers; 1063 +// BEGIN android-removed 1064 +// import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers; 1065 +// END android-removed 1066 import org.bouncycastle.asn1.eac.EACObjectIdentifiers; 1067 import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; 1068 import org.bouncycastle.asn1.oiw.OIWObjectIdentifiers; 1069 @@ -28,31 +30,43 @@ 1070 1071 public DefaultCMSSignatureAlgorithmNameGenerator() 1072 { 1073 - addEntries(NISTObjectIdentifiers.dsa_with_sha224, "SHA224", "DSA"); 1074 + // BEGIN android-removed 1075 + // addEntries(NISTObjectIdentifiers.dsa_with_sha224, "SHA224", "DSA"); 1076 + // END android-removed 1077 addEntries(NISTObjectIdentifiers.dsa_with_sha256, "SHA256", "DSA"); 1078 addEntries(NISTObjectIdentifiers.dsa_with_sha384, "SHA384", "DSA"); 1079 addEntries(NISTObjectIdentifiers.dsa_with_sha512, "SHA512", "DSA"); 1080 addEntries(OIWObjectIdentifiers.dsaWithSHA1, "SHA1", "DSA"); 1081 - addEntries(OIWObjectIdentifiers.md4WithRSA, "MD4", "RSA"); 1082 - addEntries(OIWObjectIdentifiers.md4WithRSAEncryption, "MD4", "RSA"); 1083 + // BEGIN android-removed 1084 + // addEntries(OIWObjectIdentifiers.md4WithRSA, "MD4", "RSA"); 1085 + // addEntries(OIWObjectIdentifiers.md4WithRSAEncryption, "MD4", "RSA"); 1086 + // END android-removed 1087 addEntries(OIWObjectIdentifiers.md5WithRSA, "MD5", "RSA"); 1088 addEntries(OIWObjectIdentifiers.sha1WithRSA, "SHA1", "RSA"); 1089 - addEntries(PKCSObjectIdentifiers.md2WithRSAEncryption, "MD2", "RSA"); 1090 - addEntries(PKCSObjectIdentifiers.md4WithRSAEncryption, "MD4", "RSA"); 1091 + // BEGIN android-removed 1092 + // addEntries(PKCSObjectIdentifiers.md2WithRSAEncryption, "MD2", "RSA"); 1093 + // addEntries(PKCSObjectIdentifiers.md4WithRSAEncryption, "MD4", "RSA"); 1094 + // END android-removed 1095 addEntries(PKCSObjectIdentifiers.md5WithRSAEncryption, "MD5", "RSA"); 1096 addEntries(PKCSObjectIdentifiers.sha1WithRSAEncryption, "SHA1", "RSA"); 1097 - addEntries(PKCSObjectIdentifiers.sha224WithRSAEncryption, "SHA224", "RSA"); 1098 + // BEGIN android-removed 1099 + // addEntries(PKCSObjectIdentifiers.sha224WithRSAEncryption, "SHA224", "RSA"); 1100 + // END android-removed 1101 addEntries(PKCSObjectIdentifiers.sha256WithRSAEncryption, "SHA256", "RSA"); 1102 addEntries(PKCSObjectIdentifiers.sha384WithRSAEncryption, "SHA384", "RSA"); 1103 addEntries(PKCSObjectIdentifiers.sha512WithRSAEncryption, "SHA512", "RSA"); 1104 addEntries(X9ObjectIdentifiers.ecdsa_with_SHA1, "SHA1", "ECDSA"); 1105 - addEntries(X9ObjectIdentifiers.ecdsa_with_SHA224, "SHA224", "ECDSA"); 1106 + // BEGIN android-removed 1107 + // addEntries(X9ObjectIdentifiers.ecdsa_with_SHA224, "SHA224", "ECDSA"); 1108 + // END android-removed 1109 addEntries(X9ObjectIdentifiers.ecdsa_with_SHA256, "SHA256", "ECDSA"); 1110 addEntries(X9ObjectIdentifiers.ecdsa_with_SHA384, "SHA384", "ECDSA"); 1111 addEntries(X9ObjectIdentifiers.ecdsa_with_SHA512, "SHA512", "ECDSA"); 1112 addEntries(X9ObjectIdentifiers.id_dsa_with_sha1, "SHA1", "DSA"); 1113 addEntries(EACObjectIdentifiers.id_TA_ECDSA_SHA_1, "SHA1", "ECDSA"); 1114 - addEntries(EACObjectIdentifiers.id_TA_ECDSA_SHA_224, "SHA224", "ECDSA"); 1115 + // BEGIN android-removed 1116 + // addEntries(EACObjectIdentifiers.id_TA_ECDSA_SHA_224, "SHA224", "ECDSA"); 1117 + // END android-removed 1118 addEntries(EACObjectIdentifiers.id_TA_ECDSA_SHA_256, "SHA256", "ECDSA"); 1119 addEntries(EACObjectIdentifiers.id_TA_ECDSA_SHA_384, "SHA384", "ECDSA"); 1120 addEntries(EACObjectIdentifiers.id_TA_ECDSA_SHA_512, "SHA512", "ECDSA"); 1121 @@ -66,26 +80,32 @@ 1122 encryptionAlgs.put(TeleTrusTObjectIdentifiers.teleTrusTRSAsignatureAlgorithm, "RSA"); 1123 encryptionAlgs.put(X509ObjectIdentifiers.id_ea_rsa, "RSA"); 1124 encryptionAlgs.put(PKCSObjectIdentifiers.id_RSASSA_PSS, "RSAandMGF1"); 1125 - encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3410_94, "GOST3410"); 1126 - encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3410_2001, "ECGOST3410"); 1127 - encryptionAlgs.put(new ASN1ObjectIdentifier("1.3.6.1.4.1.5849.1.6.2"), "ECGOST3410"); 1128 - encryptionAlgs.put(new ASN1ObjectIdentifier("1.3.6.1.4.1.5849.1.1.5"), "GOST3410"); 1129 - encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001, "ECGOST3410"); 1130 - encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94, "GOST3410"); 1131 - 1132 - digestAlgs.put(PKCSObjectIdentifiers.md2, "MD2"); 1133 - digestAlgs.put(PKCSObjectIdentifiers.md4, "MD4"); 1134 + // BEGIN android-removed 1135 + // encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3410_94, "GOST3410"); 1136 + // encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3410_2001, "ECGOST3410"); 1137 + // encryptionAlgs.put(new ASN1ObjectIdentifier("1.3.6.1.4.1.5849.1.6.2"), "ECGOST3410"); 1138 + // encryptionAlgs.put(new ASN1ObjectIdentifier("1.3.6.1.4.1.5849.1.1.5"), "GOST3410"); 1139 + // encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001, "ECGOST3410"); 1140 + // encryptionAlgs.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94, "GOST3410"); 1141 + // 1142 + // digestAlgs.put(PKCSObjectIdentifiers.md2, "MD2"); 1143 + // digestAlgs.put(PKCSObjectIdentifiers.md4, "MD4"); 1144 + // END android-removed 1145 digestAlgs.put(PKCSObjectIdentifiers.md5, "MD5"); 1146 digestAlgs.put(OIWObjectIdentifiers.idSHA1, "SHA1"); 1147 - digestAlgs.put(NISTObjectIdentifiers.id_sha224, "SHA224"); 1148 + // BEGIN android-removed 1149 + // digestAlgs.put(NISTObjectIdentifiers.id_sha224, "SHA224"); 1150 + // END android-removed 1151 digestAlgs.put(NISTObjectIdentifiers.id_sha256, "SHA256"); 1152 digestAlgs.put(NISTObjectIdentifiers.id_sha384, "SHA384"); 1153 digestAlgs.put(NISTObjectIdentifiers.id_sha512, "SHA512"); 1154 - digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd128, "RIPEMD128"); 1155 - digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd160, "RIPEMD160"); 1156 - digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd256, "RIPEMD256"); 1157 - digestAlgs.put(CryptoProObjectIdentifiers.gostR3411, "GOST3411"); 1158 - digestAlgs.put(new ASN1ObjectIdentifier("1.3.6.1.4.1.5849.1.2.1"), "GOST3411"); 1159 + // BEGIN android-removed 1160 + // digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd128, "RIPEMD128"); 1161 + // digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd160, "RIPEMD160"); 1162 + // digestAlgs.put(TeleTrusTObjectIdentifiers.ripemd256, "RIPEMD256"); 1163 + // digestAlgs.put(CryptoProObjectIdentifiers.gostR3411, "GOST3411"); 1164 + // digestAlgs.put(new ASN1ObjectIdentifier("1.3.6.1.4.1.5849.1.2.1"), "GOST3411"); 1165 + // END android-removed 1166 } 1167 1168 /** 1169 diff -Naur bcpkix-jdk15on-149.orig/org/bouncycastle/cms/DefaultCMSSignatureEncryptionAlgorithmFinder.java bcpkix-jdk15on-149/org/bouncycastle/cms/DefaultCMSSignatureEncryptionAlgorithmFinder.java 1170 --- bcpkix-jdk15on-149.orig/org/bouncycastle/cms/DefaultCMSSignatureEncryptionAlgorithmFinder.java 2013-05-31 21:17:22.000000000 +0000 1171 +++ bcpkix-jdk15on-149/org/bouncycastle/cms/DefaultCMSSignatureEncryptionAlgorithmFinder.java 2012-09-17 23:04:47.000000000 +0000 1172 @@ -16,21 +16,29 @@ 1173 1174 static 1175 { 1176 - RSA_PKCS1d5.add(PKCSObjectIdentifiers.md2WithRSAEncryption); 1177 - RSA_PKCS1d5.add(PKCSObjectIdentifiers.md4WithRSAEncryption); 1178 + // BEGIN android-removed 1179 + // RSA_PKCS1d5.add(PKCSObjectIdentifiers.md2WithRSAEncryption); 1180 + // RSA_PKCS1d5.add(PKCSObjectIdentifiers.md4WithRSAEncryption); 1181 + // END android-removed 1182 RSA_PKCS1d5.add(PKCSObjectIdentifiers.md5WithRSAEncryption); 1183 RSA_PKCS1d5.add(PKCSObjectIdentifiers.sha1WithRSAEncryption); 1184 - RSA_PKCS1d5.add(PKCSObjectIdentifiers.sha224WithRSAEncryption); 1185 + // BEGIN android-removed 1186 + // RSA_PKCS1d5.add(PKCSObjectIdentifiers.sha224WithRSAEncryption); 1187 + // END android-removed 1188 RSA_PKCS1d5.add(PKCSObjectIdentifiers.sha256WithRSAEncryption); 1189 RSA_PKCS1d5.add(PKCSObjectIdentifiers.sha384WithRSAEncryption); 1190 RSA_PKCS1d5.add(PKCSObjectIdentifiers.sha512WithRSAEncryption); 1191 - RSA_PKCS1d5.add(OIWObjectIdentifiers.md4WithRSAEncryption); 1192 - RSA_PKCS1d5.add(OIWObjectIdentifiers.md4WithRSA); 1193 + // BEGIN android-removed 1194 + // RSA_PKCS1d5.add(OIWObjectIdentifiers.md4WithRSAEncryption); 1195 + // RSA_PKCS1d5.add(OIWObjectIdentifiers.md4WithRSA); 1196 + // END android-removed 1197 RSA_PKCS1d5.add(OIWObjectIdentifiers.md5WithRSA); 1198 RSA_PKCS1d5.add(OIWObjectIdentifiers.sha1WithRSA); 1199 - RSA_PKCS1d5.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd128); 1200 - RSA_PKCS1d5.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd160); 1201 - RSA_PKCS1d5.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd256); 1202 + // BEGIN android-removed 1203 + // RSA_PKCS1d5.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd128); 1204 + // RSA_PKCS1d5.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd160); 1205 + // RSA_PKCS1d5.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd256); 1206 + // END android-removed 1207 } 1208 1209 public AlgorithmIdentifier findEncryptionAlgorithm(AlgorithmIdentifier signatureAlgorithm) 1210 diff -Naur bcpkix-jdk15on-149.orig/org/bouncycastle/operator/DefaultDigestAlgorithmIdentifierFinder.java bcpkix-jdk15on-149/org/bouncycastle/operator/DefaultDigestAlgorithmIdentifierFinder.java 1211 --- bcpkix-jdk15on-149.orig/org/bouncycastle/operator/DefaultDigestAlgorithmIdentifierFinder.java 2013-05-31 21:17:22.000000000 +0000 1212 +++ bcpkix-jdk15on-149/org/bouncycastle/operator/DefaultDigestAlgorithmIdentifierFinder.java 2013-01-31 02:26:40.000000000 +0000 1213 @@ -5,7 +5,9 @@ 1214 1215 import org.bouncycastle.asn1.ASN1ObjectIdentifier; 1216 import org.bouncycastle.asn1.DERNull; 1217 -import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers; 1218 +// BEGIN android-removed 1219 +// import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers; 1220 +// END android-removed 1221 import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; 1222 import org.bouncycastle.asn1.oiw.OIWObjectIdentifiers; 1223 import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers; 1224 @@ -25,53 +27,71 @@ 1225 // 1226 // digests 1227 // 1228 - digestOids.put(OIWObjectIdentifiers.md4WithRSAEncryption, PKCSObjectIdentifiers.md4); 1229 - digestOids.put(OIWObjectIdentifiers.md4WithRSA, PKCSObjectIdentifiers.md4); 1230 + // BEGIN android-removed 1231 + // digestOids.put(OIWObjectIdentifiers.md4WithRSAEncryption, PKCSObjectIdentifiers.md4); 1232 + // digestOids.put(OIWObjectIdentifiers.md4WithRSA, PKCSObjectIdentifiers.md4); 1233 + // END android-removed 1234 digestOids.put(OIWObjectIdentifiers.sha1WithRSA, OIWObjectIdentifiers.idSHA1); 1235 1236 - digestOids.put(PKCSObjectIdentifiers.sha224WithRSAEncryption, NISTObjectIdentifiers.id_sha224); 1237 + // BEGIN android-removed 1238 + // digestOids.put(PKCSObjectIdentifiers.sha224WithRSAEncryption, NISTObjectIdentifiers.id_sha224); 1239 + // END android-removed 1240 digestOids.put(PKCSObjectIdentifiers.sha256WithRSAEncryption, NISTObjectIdentifiers.id_sha256); 1241 digestOids.put(PKCSObjectIdentifiers.sha384WithRSAEncryption, NISTObjectIdentifiers.id_sha384); 1242 digestOids.put(PKCSObjectIdentifiers.sha512WithRSAEncryption, NISTObjectIdentifiers.id_sha512); 1243 - digestOids.put(PKCSObjectIdentifiers.md2WithRSAEncryption, PKCSObjectIdentifiers.md2); 1244 - digestOids.put(PKCSObjectIdentifiers.md4WithRSAEncryption, PKCSObjectIdentifiers.md4); 1245 + // BEGIN android-removed 1246 + // digestOids.put(PKCSObjectIdentifiers.md2WithRSAEncryption, PKCSObjectIdentifiers.md2); 1247 + // digestOids.put(PKCSObjectIdentifiers.md4WithRSAEncryption, PKCSObjectIdentifiers.md4); 1248 + // END android-removed 1249 digestOids.put(PKCSObjectIdentifiers.md5WithRSAEncryption, PKCSObjectIdentifiers.md5); 1250 digestOids.put(PKCSObjectIdentifiers.sha1WithRSAEncryption, OIWObjectIdentifiers.idSHA1); 1251 1252 digestOids.put(X9ObjectIdentifiers.ecdsa_with_SHA1, OIWObjectIdentifiers.idSHA1); 1253 - digestOids.put(X9ObjectIdentifiers.ecdsa_with_SHA224, NISTObjectIdentifiers.id_sha224); 1254 + // BEGIN android-removed 1255 + // digestOids.put(X9ObjectIdentifiers.ecdsa_with_SHA224, NISTObjectIdentifiers.id_sha224); 1256 + // END android-removed 1257 digestOids.put(X9ObjectIdentifiers.ecdsa_with_SHA256, NISTObjectIdentifiers.id_sha256); 1258 digestOids.put(X9ObjectIdentifiers.ecdsa_with_SHA384, NISTObjectIdentifiers.id_sha384); 1259 digestOids.put(X9ObjectIdentifiers.ecdsa_with_SHA512, NISTObjectIdentifiers.id_sha512); 1260 digestOids.put(X9ObjectIdentifiers.id_dsa_with_sha1, OIWObjectIdentifiers.idSHA1); 1261 1262 - digestOids.put(NISTObjectIdentifiers.dsa_with_sha224, NISTObjectIdentifiers.id_sha224); 1263 + // BEGIN android-removed 1264 + // digestOids.put(NISTObjectIdentifiers.dsa_with_sha224, NISTObjectIdentifiers.id_sha224); 1265 + // END android-removed 1266 digestOids.put(NISTObjectIdentifiers.dsa_with_sha256, NISTObjectIdentifiers.id_sha256); 1267 digestOids.put(NISTObjectIdentifiers.dsa_with_sha384, NISTObjectIdentifiers.id_sha384); 1268 digestOids.put(NISTObjectIdentifiers.dsa_with_sha512, NISTObjectIdentifiers.id_sha512); 1269 1270 - digestOids.put(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd128, TeleTrusTObjectIdentifiers.ripemd128); 1271 - digestOids.put(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd160, TeleTrusTObjectIdentifiers.ripemd160); 1272 - digestOids.put(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd256, TeleTrusTObjectIdentifiers.ripemd256); 1273 - 1274 - digestOids.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94, CryptoProObjectIdentifiers.gostR3411); 1275 - digestOids.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001, CryptoProObjectIdentifiers.gostR3411); 1276 + // BEGIN android-removed 1277 + // digestOids.put(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd128, TeleTrusTObjectIdentifiers.ripemd128); 1278 + // digestOids.put(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd160, TeleTrusTObjectIdentifiers.ripemd160); 1279 + // digestOids.put(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd256, TeleTrusTObjectIdentifiers.ripemd256); 1280 + // 1281 + // digestOids.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94, CryptoProObjectIdentifiers.gostR3411); 1282 + // digestOids.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001, CryptoProObjectIdentifiers.gostR3411); 1283 + // END android-removed 1284 1285 digestNameToOids.put("SHA-1", OIWObjectIdentifiers.idSHA1); 1286 - digestNameToOids.put("SHA-224", NISTObjectIdentifiers.id_sha224); 1287 + // BEGIN android-removed 1288 + // digestNameToOids.put("SHA-224", NISTObjectIdentifiers.id_sha224); 1289 + // END android-removed 1290 digestNameToOids.put("SHA-256", NISTObjectIdentifiers.id_sha256); 1291 digestNameToOids.put("SHA-384", NISTObjectIdentifiers.id_sha384); 1292 digestNameToOids.put("SHA-512", NISTObjectIdentifiers.id_sha512); 1293 1294 - digestNameToOids.put("GOST3411", CryptoProObjectIdentifiers.gostR3411); 1295 - 1296 - digestNameToOids.put("MD2", PKCSObjectIdentifiers.md2); 1297 - digestNameToOids.put("MD4", PKCSObjectIdentifiers.md4); 1298 + // BEGIN android-removed 1299 + // digestNameToOids.put("GOST3411", CryptoProObjectIdentifiers.gostR3411); 1300 + // 1301 + // digestNameToOids.put("MD2", PKCSObjectIdentifiers.md2); 1302 + // digestNameToOids.put("MD4", PKCSObjectIdentifiers.md4); 1303 + // END android-removed 1304 digestNameToOids.put("MD5", PKCSObjectIdentifiers.md5); 1305 1306 - digestNameToOids.put("RIPEMD128", TeleTrusTObjectIdentifiers.ripemd128); 1307 - digestNameToOids.put("RIPEMD160", TeleTrusTObjectIdentifiers.ripemd160); 1308 - digestNameToOids.put("RIPEMD256", TeleTrusTObjectIdentifiers.ripemd256); 1309 + // BEGIN android-removed 1310 + // digestNameToOids.put("RIPEMD128", TeleTrusTObjectIdentifiers.ripemd128); 1311 + // digestNameToOids.put("RIPEMD160", TeleTrusTObjectIdentifiers.ripemd160); 1312 + // digestNameToOids.put("RIPEMD256", TeleTrusTObjectIdentifiers.ripemd256); 1313 + // END android-removed 1314 } 1315 1316 public AlgorithmIdentifier find(AlgorithmIdentifier sigAlgId) 1317 diff -Naur bcpkix-jdk15on-149.orig/org/bouncycastle/operator/DefaultSignatureAlgorithmIdentifierFinder.java bcpkix-jdk15on-149/org/bouncycastle/operator/DefaultSignatureAlgorithmIdentifierFinder.java 1318 --- bcpkix-jdk15on-149.orig/org/bouncycastle/operator/DefaultSignatureAlgorithmIdentifierFinder.java 2013-05-31 21:17:22.000000000 +0000 1319 +++ bcpkix-jdk15on-149/org/bouncycastle/operator/DefaultSignatureAlgorithmIdentifierFinder.java 2013-01-31 02:26:40.000000000 +0000 1320 @@ -9,7 +9,9 @@ 1321 import org.bouncycastle.asn1.ASN1Integer; 1322 import org.bouncycastle.asn1.ASN1ObjectIdentifier; 1323 import org.bouncycastle.asn1.DERNull; 1324 -import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers; 1325 +// BEGIN android-removed 1326 +// import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers; 1327 +// END android-removed 1328 import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; 1329 import org.bouncycastle.asn1.oiw.OIWObjectIdentifiers; 1330 import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers; 1331 @@ -32,19 +34,25 @@ 1332 private static final ASN1ObjectIdentifier ENCRYPTION_DSA = X9ObjectIdentifiers.id_dsa_with_sha1; 1333 private static final ASN1ObjectIdentifier ENCRYPTION_ECDSA = X9ObjectIdentifiers.ecdsa_with_SHA1; 1334 private static final ASN1ObjectIdentifier ENCRYPTION_RSA_PSS = PKCSObjectIdentifiers.id_RSASSA_PSS; 1335 - private static final ASN1ObjectIdentifier ENCRYPTION_GOST3410 = CryptoProObjectIdentifiers.gostR3410_94; 1336 - private static final ASN1ObjectIdentifier ENCRYPTION_ECGOST3410 = CryptoProObjectIdentifiers.gostR3410_2001; 1337 + // BEGIN android-removed 1338 + // private static final ASN1ObjectIdentifier ENCRYPTION_GOST3410 = CryptoProObjectIdentifiers.gostR3410_94; 1339 + // private static final ASN1ObjectIdentifier ENCRYPTION_ECGOST3410 = CryptoProObjectIdentifiers.gostR3410_2001; 1340 + // END android-removed 1341 1342 static 1343 { 1344 - algorithms.put("MD2WITHRSAENCRYPTION", PKCSObjectIdentifiers.md2WithRSAEncryption); 1345 - algorithms.put("MD2WITHRSA", PKCSObjectIdentifiers.md2WithRSAEncryption); 1346 + // BEGIN android-removed 1347 + // algorithms.put("MD2WITHRSAENCRYPTION", PKCSObjectIdentifiers.md2WithRSAEncryption); 1348 + // algorithms.put("MD2WITHRSA", PKCSObjectIdentifiers.md2WithRSAEncryption); 1349 + // END android-removed 1350 algorithms.put("MD5WITHRSAENCRYPTION", PKCSObjectIdentifiers.md5WithRSAEncryption); 1351 algorithms.put("MD5WITHRSA", PKCSObjectIdentifiers.md5WithRSAEncryption); 1352 algorithms.put("SHA1WITHRSAENCRYPTION", PKCSObjectIdentifiers.sha1WithRSAEncryption); 1353 algorithms.put("SHA1WITHRSA", PKCSObjectIdentifiers.sha1WithRSAEncryption); 1354 - algorithms.put("SHA224WITHRSAENCRYPTION", PKCSObjectIdentifiers.sha224WithRSAEncryption); 1355 - algorithms.put("SHA224WITHRSA", PKCSObjectIdentifiers.sha224WithRSAEncryption); 1356 + // BEGIN android-removed 1357 + // algorithms.put("SHA224WITHRSAENCRYPTION", PKCSObjectIdentifiers.sha224WithRSAEncryption); 1358 + // algorithms.put("SHA224WITHRSA", PKCSObjectIdentifiers.sha224WithRSAEncryption); 1359 + // END android-removed 1360 algorithms.put("SHA256WITHRSAENCRYPTION", PKCSObjectIdentifiers.sha256WithRSAEncryption); 1361 algorithms.put("SHA256WITHRSA", PKCSObjectIdentifiers.sha256WithRSAEncryption); 1362 algorithms.put("SHA384WITHRSAENCRYPTION", PKCSObjectIdentifiers.sha384WithRSAEncryption); 1363 @@ -52,45 +60,59 @@ 1364 algorithms.put("SHA512WITHRSAENCRYPTION", PKCSObjectIdentifiers.sha512WithRSAEncryption); 1365 algorithms.put("SHA512WITHRSA", PKCSObjectIdentifiers.sha512WithRSAEncryption); 1366 algorithms.put("SHA1WITHRSAANDMGF1", PKCSObjectIdentifiers.id_RSASSA_PSS); 1367 - algorithms.put("SHA224WITHRSAANDMGF1", PKCSObjectIdentifiers.id_RSASSA_PSS); 1368 + // BEGIN android-removed 1369 + // algorithms.put("SHA224WITHRSAANDMGF1", PKCSObjectIdentifiers.id_RSASSA_PSS); 1370 + // END android-removed 1371 algorithms.put("SHA256WITHRSAANDMGF1", PKCSObjectIdentifiers.id_RSASSA_PSS); 1372 algorithms.put("SHA384WITHRSAANDMGF1", PKCSObjectIdentifiers.id_RSASSA_PSS); 1373 algorithms.put("SHA512WITHRSAANDMGF1", PKCSObjectIdentifiers.id_RSASSA_PSS); 1374 - algorithms.put("RIPEMD160WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.rsaSignatureWithripemd160); 1375 - algorithms.put("RIPEMD160WITHRSA", TeleTrusTObjectIdentifiers.rsaSignatureWithripemd160); 1376 - algorithms.put("RIPEMD128WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.rsaSignatureWithripemd128); 1377 - algorithms.put("RIPEMD128WITHRSA", TeleTrusTObjectIdentifiers.rsaSignatureWithripemd128); 1378 - algorithms.put("RIPEMD256WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.rsaSignatureWithripemd256); 1379 - algorithms.put("RIPEMD256WITHRSA", TeleTrusTObjectIdentifiers.rsaSignatureWithripemd256); 1380 + // BEGIN android-removed 1381 + // algorithms.put("RIPEMD160WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.rsaSignatureWithripemd160); 1382 + // algorithms.put("RIPEMD160WITHRSA", TeleTrusTObjectIdentifiers.rsaSignatureWithripemd160); 1383 + // algorithms.put("RIPEMD128WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.rsaSignatureWithripemd128); 1384 + // algorithms.put("RIPEMD128WITHRSA", TeleTrusTObjectIdentifiers.rsaSignatureWithripemd128); 1385 + // algorithms.put("RIPEMD256WITHRSAENCRYPTION", TeleTrusTObjectIdentifiers.rsaSignatureWithripemd256); 1386 + // algorithms.put("RIPEMD256WITHRSA", TeleTrusTObjectIdentifiers.rsaSignatureWithripemd256); 1387 + // END android-removed 1388 algorithms.put("SHA1WITHDSA", X9ObjectIdentifiers.id_dsa_with_sha1); 1389 algorithms.put("DSAWITHSHA1", X9ObjectIdentifiers.id_dsa_with_sha1); 1390 - algorithms.put("SHA224WITHDSA", NISTObjectIdentifiers.dsa_with_sha224); 1391 + // BEGIN android-removed 1392 + // algorithms.put("SHA224WITHDSA", NISTObjectIdentifiers.dsa_with_sha224); 1393 + // END android-removed 1394 algorithms.put("SHA256WITHDSA", NISTObjectIdentifiers.dsa_with_sha256); 1395 algorithms.put("SHA384WITHDSA", NISTObjectIdentifiers.dsa_with_sha384); 1396 algorithms.put("SHA512WITHDSA", NISTObjectIdentifiers.dsa_with_sha512); 1397 algorithms.put("SHA1WITHECDSA", X9ObjectIdentifiers.ecdsa_with_SHA1); 1398 algorithms.put("ECDSAWITHSHA1", X9ObjectIdentifiers.ecdsa_with_SHA1); 1399 - algorithms.put("SHA224WITHECDSA", X9ObjectIdentifiers.ecdsa_with_SHA224); 1400 + // BEGIN android-removed 1401 + // algorithms.put("SHA224WITHECDSA", X9ObjectIdentifiers.ecdsa_with_SHA224); 1402 + // END android-removed 1403 algorithms.put("SHA256WITHECDSA", X9ObjectIdentifiers.ecdsa_with_SHA256); 1404 algorithms.put("SHA384WITHECDSA", X9ObjectIdentifiers.ecdsa_with_SHA384); 1405 algorithms.put("SHA512WITHECDSA", X9ObjectIdentifiers.ecdsa_with_SHA512); 1406 - algorithms.put("GOST3411WITHGOST3410", CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94); 1407 - algorithms.put("GOST3411WITHGOST3410-94", CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94); 1408 - algorithms.put("GOST3411WITHECGOST3410", CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001); 1409 - algorithms.put("GOST3411WITHECGOST3410-2001", CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001); 1410 - algorithms.put("GOST3411WITHGOST3410-2001", CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001); 1411 + // BEGIN android-removed 1412 + // algorithms.put("GOST3411WITHGOST3410", CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94); 1413 + // algorithms.put("GOST3411WITHGOST3410-94", CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94); 1414 + // algorithms.put("GOST3411WITHECGOST3410", CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001); 1415 + // algorithms.put("GOST3411WITHECGOST3410-2001", CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001); 1416 + // algorithms.put("GOST3411WITHGOST3410-2001", CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001); 1417 + // END android-removed 1418 1419 // 1420 // According to RFC 3279, the ASN.1 encoding SHALL (id-dsa-with-sha1) or MUST (ecdsa-with-SHA*) omit the parameters field. 1421 // The parameters field SHALL be NULL for RSA based signature algorithms. 1422 // 1423 noParams.add(X9ObjectIdentifiers.ecdsa_with_SHA1); 1424 - noParams.add(X9ObjectIdentifiers.ecdsa_with_SHA224); 1425 + // BEGIN android-removed 1426 + // noParams.add(X9ObjectIdentifiers.ecdsa_with_SHA224); 1427 + // END android-removed 1428 noParams.add(X9ObjectIdentifiers.ecdsa_with_SHA256); 1429 noParams.add(X9ObjectIdentifiers.ecdsa_with_SHA384); 1430 noParams.add(X9ObjectIdentifiers.ecdsa_with_SHA512); 1431 noParams.add(X9ObjectIdentifiers.id_dsa_with_sha1); 1432 - noParams.add(NISTObjectIdentifiers.dsa_with_sha224); 1433 + // BEGIN android-removed 1434 + // noParams.add(NISTObjectIdentifiers.dsa_with_sha224); 1435 + // END android-removed 1436 noParams.add(NISTObjectIdentifiers.dsa_with_sha256); 1437 noParams.add(NISTObjectIdentifiers.dsa_with_sha384); 1438 noParams.add(NISTObjectIdentifiers.dsa_with_sha512); 1439 @@ -98,20 +120,26 @@ 1440 // 1441 // RFC 4491 1442 // 1443 - noParams.add(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94); 1444 - noParams.add(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001); 1445 + // BEGIN android-removed 1446 + // noParams.add(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94); 1447 + // noParams.add(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001); 1448 + // END android-removed 1449 1450 // 1451 // PKCS 1.5 encrypted algorithms 1452 // 1453 pkcs15RsaEncryption.add(PKCSObjectIdentifiers.sha1WithRSAEncryption); 1454 - pkcs15RsaEncryption.add(PKCSObjectIdentifiers.sha224WithRSAEncryption); 1455 + // BEGIN android-removed 1456 + // pkcs15RsaEncryption.add(PKCSObjectIdentifiers.sha224WithRSAEncryption); 1457 + // END android-removed 1458 pkcs15RsaEncryption.add(PKCSObjectIdentifiers.sha256WithRSAEncryption); 1459 pkcs15RsaEncryption.add(PKCSObjectIdentifiers.sha384WithRSAEncryption); 1460 pkcs15RsaEncryption.add(PKCSObjectIdentifiers.sha512WithRSAEncryption); 1461 - pkcs15RsaEncryption.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd128); 1462 - pkcs15RsaEncryption.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd160); 1463 - pkcs15RsaEncryption.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd256); 1464 + // BEGIN android-removed 1465 + // pkcs15RsaEncryption.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd128); 1466 + // pkcs15RsaEncryption.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd160); 1467 + // pkcs15RsaEncryption.add(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd256); 1468 + // END android-removed 1469 1470 // 1471 // explicit params 1472 @@ -119,8 +147,10 @@ 1473 AlgorithmIdentifier sha1AlgId = new AlgorithmIdentifier(OIWObjectIdentifiers.idSHA1, DERNull.INSTANCE); 1474 params.put("SHA1WITHRSAANDMGF1", createPSSParams(sha1AlgId, 20)); 1475 1476 - AlgorithmIdentifier sha224AlgId = new AlgorithmIdentifier(NISTObjectIdentifiers.id_sha224, DERNull.INSTANCE); 1477 - params.put("SHA224WITHRSAANDMGF1", createPSSParams(sha224AlgId, 28)); 1478 + // BEGIN android-removed 1479 + // AlgorithmIdentifier sha224AlgId = new AlgorithmIdentifier(NISTObjectIdentifiers.id_sha224, DERNull.INSTANCE); 1480 + // params.put("SHA224WITHRSAANDMGF1", createPSSParams(sha224AlgId, 28)); 1481 + // END android-removed 1482 1483 AlgorithmIdentifier sha256AlgId = new AlgorithmIdentifier(NISTObjectIdentifiers.id_sha256, DERNull.INSTANCE); 1484 params.put("SHA256WITHRSAANDMGF1", createPSSParams(sha256AlgId, 32)); 1485 @@ -134,19 +164,25 @@ 1486 // 1487 // digests 1488 // 1489 - digestOids.put(PKCSObjectIdentifiers.sha224WithRSAEncryption, NISTObjectIdentifiers.id_sha224); 1490 + // BEGIN android-removed 1491 + // digestOids.put(PKCSObjectIdentifiers.sha224WithRSAEncryption, NISTObjectIdentifiers.id_sha224); 1492 + // END android-removed 1493 digestOids.put(PKCSObjectIdentifiers.sha256WithRSAEncryption, NISTObjectIdentifiers.id_sha256); 1494 digestOids.put(PKCSObjectIdentifiers.sha384WithRSAEncryption, NISTObjectIdentifiers.id_sha384); 1495 digestOids.put(PKCSObjectIdentifiers.sha512WithRSAEncryption, NISTObjectIdentifiers.id_sha512); 1496 - digestOids.put(PKCSObjectIdentifiers.md2WithRSAEncryption, PKCSObjectIdentifiers.md2); 1497 - digestOids.put(PKCSObjectIdentifiers.md4WithRSAEncryption, PKCSObjectIdentifiers.md4); 1498 + // BEGIN android-removed 1499 + // digestOids.put(PKCSObjectIdentifiers.md2WithRSAEncryption, PKCSObjectIdentifiers.md2); 1500 + // digestOids.put(PKCSObjectIdentifiers.md4WithRSAEncryption, PKCSObjectIdentifiers.md4); 1501 + // END android-removed 1502 digestOids.put(PKCSObjectIdentifiers.md5WithRSAEncryption, PKCSObjectIdentifiers.md5); 1503 digestOids.put(PKCSObjectIdentifiers.sha1WithRSAEncryption, OIWObjectIdentifiers.idSHA1); 1504 - digestOids.put(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd128, TeleTrusTObjectIdentifiers.ripemd128); 1505 - digestOids.put(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd160, TeleTrusTObjectIdentifiers.ripemd160); 1506 - digestOids.put(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd256, TeleTrusTObjectIdentifiers.ripemd256); 1507 - digestOids.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94, CryptoProObjectIdentifiers.gostR3411); 1508 - digestOids.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001, CryptoProObjectIdentifiers.gostR3411); 1509 + // BEGIN android-removed 1510 + // digestOids.put(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd128, TeleTrusTObjectIdentifiers.ripemd128); 1511 + // digestOids.put(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd160, TeleTrusTObjectIdentifiers.ripemd160); 1512 + // digestOids.put(TeleTrusTObjectIdentifiers.rsaSignatureWithripemd256, TeleTrusTObjectIdentifiers.ripemd256); 1513 + // digestOids.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94, CryptoProObjectIdentifiers.gostR3411); 1514 + // digestOids.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001, CryptoProObjectIdentifiers.gostR3411); 1515 + // END android-removed 1516 } 1517 1518 private static AlgorithmIdentifier generate(String signatureAlgorithm) 1519 diff -Naur bcpkix-jdk15on-149.orig/org/bouncycastle/operator/bc/BcDefaultDigestProvider.java bcpkix-jdk15on-149/org/bouncycastle/operator/bc/BcDefaultDigestProvider.java 1520 --- bcpkix-jdk15on-149.orig/org/bouncycastle/operator/bc/BcDefaultDigestProvider.java 2013-05-31 21:17:22.000000000 +0000 1521 +++ bcpkix-jdk15on-149/org/bouncycastle/operator/bc/BcDefaultDigestProvider.java 2013-05-25 02:14:15.000000000 +0000 1522 @@ -4,22 +4,30 @@ 1523 import java.util.HashMap; 1524 import java.util.Map; 1525 1526 -import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers; 1527 +// BEGIN android-removed 1528 +// import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers; 1529 +// END android-removed 1530 import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; 1531 import org.bouncycastle.asn1.oiw.OIWObjectIdentifiers; 1532 import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers; 1533 import org.bouncycastle.asn1.teletrust.TeleTrusTObjectIdentifiers; 1534 import org.bouncycastle.asn1.x509.AlgorithmIdentifier; 1535 import org.bouncycastle.crypto.ExtendedDigest; 1536 -import org.bouncycastle.crypto.digests.GOST3411Digest; 1537 -import org.bouncycastle.crypto.digests.MD2Digest; 1538 -import org.bouncycastle.crypto.digests.MD4Digest; 1539 +// BEGIN android-removed 1540 +// import org.bouncycastle.crypto.digests.GOST3411Digest; 1541 +// import org.bouncycastle.crypto.digests.MD2Digest; 1542 +// import org.bouncycastle.crypto.digests.MD4Digest; 1543 +// END android-removed 1544 import org.bouncycastle.crypto.digests.MD5Digest; 1545 -import org.bouncycastle.crypto.digests.RIPEMD128Digest; 1546 -import org.bouncycastle.crypto.digests.RIPEMD160Digest; 1547 -import org.bouncycastle.crypto.digests.RIPEMD256Digest; 1548 +// BEGIN android-removed 1549 +// import org.bouncycastle.crypto.digests.RIPEMD128Digest; 1550 +// import org.bouncycastle.crypto.digests.RIPEMD160Digest; 1551 +// import org.bouncycastle.crypto.digests.RIPEMD256Digest; 1552 +// END android-removed 1553 import org.bouncycastle.crypto.digests.SHA1Digest; 1554 -import org.bouncycastle.crypto.digests.SHA224Digest; 1555 +// BEGIN android-removed 1556 +// import org.bouncycastle.crypto.digests.SHA224Digest; 1557 +// END android-removed 1558 import org.bouncycastle.crypto.digests.SHA256Digest; 1559 import org.bouncycastle.crypto.digests.SHA384Digest; 1560 import org.bouncycastle.crypto.digests.SHA512Digest; 1561 @@ -41,13 +49,15 @@ 1562 return new SHA1Digest(); 1563 } 1564 }); 1565 - table.put(NISTObjectIdentifiers.id_sha224, new BcDigestProvider() 1566 - { 1567 - public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1568 - { 1569 - return new SHA224Digest(); 1570 - } 1571 - }); 1572 + // BEGIN android-removed 1573 + // table.put(NISTObjectIdentifiers.id_sha224, new BcDigestProvider() 1574 + // { 1575 + // public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1576 + // { 1577 + // return new SHA224Digest(); 1578 + // } 1579 + // }); 1580 + // END android-removed 1581 table.put(NISTObjectIdentifiers.id_sha256, new BcDigestProvider() 1582 { 1583 public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1584 @@ -76,48 +86,50 @@ 1585 return new MD5Digest(); 1586 } 1587 }); 1588 - table.put(PKCSObjectIdentifiers.md4, new BcDigestProvider() 1589 - { 1590 - public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1591 - { 1592 - return new MD4Digest(); 1593 - } 1594 - }); 1595 - table.put(PKCSObjectIdentifiers.md2, new BcDigestProvider() 1596 - { 1597 - public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1598 - { 1599 - return new MD2Digest(); 1600 - } 1601 - }); 1602 - table.put(CryptoProObjectIdentifiers.gostR3411, new BcDigestProvider() 1603 - { 1604 - public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1605 - { 1606 - return new GOST3411Digest(); 1607 - } 1608 - }); 1609 - table.put(TeleTrusTObjectIdentifiers.ripemd128, new BcDigestProvider() 1610 - { 1611 - public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1612 - { 1613 - return new RIPEMD128Digest(); 1614 - } 1615 - }); 1616 - table.put(TeleTrusTObjectIdentifiers.ripemd160, new BcDigestProvider() 1617 - { 1618 - public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1619 - { 1620 - return new RIPEMD160Digest(); 1621 - } 1622 - }); 1623 - table.put(TeleTrusTObjectIdentifiers.ripemd256, new BcDigestProvider() 1624 - { 1625 - public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1626 - { 1627 - return new RIPEMD256Digest(); 1628 - } 1629 - }); 1630 + // BEGIN android-removed 1631 + // table.put(PKCSObjectIdentifiers.md4, new BcDigestProvider() 1632 + // { 1633 + // public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1634 + // { 1635 + // return new MD4Digest(); 1636 + // } 1637 + // }); 1638 + // table.put(PKCSObjectIdentifiers.md2, new BcDigestProvider() 1639 + // { 1640 + // public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1641 + // { 1642 + // return new MD2Digest(); 1643 + // } 1644 + // }); 1645 + // table.put(CryptoProObjectIdentifiers.gostR3411, new BcDigestProvider() 1646 + // { 1647 + // public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1648 + // { 1649 + // return new GOST3411Digest(); 1650 + // } 1651 + // }); 1652 + // table.put(TeleTrusTObjectIdentifiers.ripemd128, new BcDigestProvider() 1653 + // { 1654 + // public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1655 + // { 1656 + // return new RIPEMD128Digest(); 1657 + // } 1658 + // }); 1659 + // table.put(TeleTrusTObjectIdentifiers.ripemd160, new BcDigestProvider() 1660 + // { 1661 + // public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1662 + // { 1663 + // return new RIPEMD160Digest(); 1664 + // } 1665 + // }); 1666 + // table.put(TeleTrusTObjectIdentifiers.ripemd256, new BcDigestProvider() 1667 + // { 1668 + // public ExtendedDigest get(AlgorithmIdentifier digestAlgorithmIdentifier) 1669 + // { 1670 + // return new RIPEMD256Digest(); 1671 + // } 1672 + // }); 1673 + // END android-removed 1674 1675 return Collections.unmodifiableMap(table); 1676 } 1677 diff -Naur bcpkix-jdk15on-149.orig/org/bouncycastle/operator/jcajce/OperatorHelper.java bcpkix-jdk15on-149/org/bouncycastle/operator/jcajce/OperatorHelper.java 1678 --- bcpkix-jdk15on-149.orig/org/bouncycastle/operator/jcajce/OperatorHelper.java 2013-05-31 21:17:22.000000000 +0000 1679 +++ bcpkix-jdk15on-149/org/bouncycastle/operator/jcajce/OperatorHelper.java 2013-01-31 02:26:40.000000000 +0000 1680 @@ -20,7 +20,9 @@ 1681 import org.bouncycastle.asn1.ASN1Encodable; 1682 import org.bouncycastle.asn1.ASN1ObjectIdentifier; 1683 import org.bouncycastle.asn1.DERNull; 1684 -import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers; 1685 +// BEGIN android-removed 1686 +// import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers; 1687 +// END android-removed 1688 import org.bouncycastle.asn1.kisa.KISAObjectIdentifiers; 1689 import org.bouncycastle.asn1.nist.NISTObjectIdentifiers; 1690 import org.bouncycastle.asn1.ntt.NTTObjectIdentifiers; 1691 @@ -47,24 +49,34 @@ 1692 // reverse mappings 1693 // 1694 oids.put(new ASN1ObjectIdentifier("1.2.840.113549.1.1.5"), "SHA1WITHRSA"); 1695 - oids.put(PKCSObjectIdentifiers.sha224WithRSAEncryption, "SHA224WITHRSA"); 1696 + // BEGIN android-removed 1697 + // oids.put(PKCSObjectIdentifiers.sha224WithRSAEncryption, "SHA224WITHRSA"); 1698 + // END android-removed 1699 oids.put(PKCSObjectIdentifiers.sha256WithRSAEncryption, "SHA256WITHRSA"); 1700 oids.put(PKCSObjectIdentifiers.sha384WithRSAEncryption, "SHA384WITHRSA"); 1701 oids.put(PKCSObjectIdentifiers.sha512WithRSAEncryption, "SHA512WITHRSA"); 1702 - oids.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94, "GOST3411WITHGOST3410"); 1703 - oids.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001, "GOST3411WITHECGOST3410"); 1704 + // BEGIN android-removed 1705 + // oids.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_94, "GOST3411WITHGOST3410"); 1706 + // oids.put(CryptoProObjectIdentifiers.gostR3411_94_with_gostR3410_2001, "GOST3411WITHECGOST3410"); 1707 + // END android-removed 1708 1709 oids.put(new ASN1ObjectIdentifier("1.2.840.113549.1.1.4"), "MD5WITHRSA"); 1710 - oids.put(new ASN1ObjectIdentifier("1.2.840.113549.1.1.2"), "MD2WITHRSA"); 1711 + // BEGIN android-removed 1712 + // oids.put(new ASN1ObjectIdentifier("1.2.840.113549.1.1.2"), "MD2WITHRSA"); 1713 + // END android-removed 1714 oids.put(new ASN1ObjectIdentifier("1.2.840.10040.4.3"), "SHA1WITHDSA"); 1715 oids.put(X9ObjectIdentifiers.ecdsa_with_SHA1, "SHA1WITHECDSA"); 1716 - oids.put(X9ObjectIdentifiers.ecdsa_with_SHA224, "SHA224WITHECDSA"); 1717 + // BEGIN android-removed 1718 + // oids.put(X9ObjectIdentifiers.ecdsa_with_SHA224, "SHA224WITHECDSA"); 1719 + // END android-removed 1720 oids.put(X9ObjectIdentifiers.ecdsa_with_SHA256, "SHA256WITHECDSA"); 1721 oids.put(X9ObjectIdentifiers.ecdsa_with_SHA384, "SHA384WITHECDSA"); 1722 oids.put(X9ObjectIdentifiers.ecdsa_with_SHA512, "SHA512WITHECDSA"); 1723 oids.put(OIWObjectIdentifiers.sha1WithRSA, "SHA1WITHRSA"); 1724 oids.put(OIWObjectIdentifiers.dsaWithSHA1, "SHA1WITHDSA"); 1725 - oids.put(NISTObjectIdentifiers.dsa_with_sha224, "SHA224WITHDSA"); 1726 + // BEGIN android-removed 1727 + // oids.put(NISTObjectIdentifiers.dsa_with_sha224, "SHA224WITHDSA"); 1728 + // END android-removed 1729 oids.put(NISTObjectIdentifiers.dsa_with_sha256, "SHA256WITHDSA"); 1730 1731 oids.put(OIWObjectIdentifiers.idSHA1, "SHA-1"); 1732 @@ -305,10 +317,12 @@ 1733 { 1734 return "SHA1"; 1735 } 1736 - else if (NISTObjectIdentifiers.id_sha224.equals(digestAlgOID)) 1737 - { 1738 - return "SHA224"; 1739 - } 1740 + // BEGIN android-removed 1741 + // else if (NISTObjectIdentifiers.id_sha224.equals(digestAlgOID)) 1742 + // { 1743 + // return "SHA224"; 1744 + // } 1745 + // END android-removed 1746 else if (NISTObjectIdentifiers.id_sha256.equals(digestAlgOID)) 1747 { 1748 return "SHA256"; 1749 @@ -321,22 +335,24 @@ 1750 { 1751 return "SHA512"; 1752 } 1753 - else if (TeleTrusTObjectIdentifiers.ripemd128.equals(digestAlgOID)) 1754 - { 1755 - return "RIPEMD128"; 1756 - } 1757 - else if (TeleTrusTObjectIdentifiers.ripemd160.equals(digestAlgOID)) 1758 - { 1759 - return "RIPEMD160"; 1760 - } 1761 - else if (TeleTrusTObjectIdentifiers.ripemd256.equals(digestAlgOID)) 1762 - { 1763 - return "RIPEMD256"; 1764 - } 1765 - else if (CryptoProObjectIdentifiers.gostR3411.equals(digestAlgOID)) 1766 - { 1767 - return "GOST3411"; 1768 - } 1769 + // BEGIN android-removed 1770 + // else if (TeleTrusTObjectIdentifiers.ripemd128.equals(digestAlgOID)) 1771 + // { 1772 + // return "RIPEMD128"; 1773 + // } 1774 + // else if (TeleTrusTObjectIdentifiers.ripemd160.equals(digestAlgOID)) 1775 + // { 1776 + // return "RIPEMD160"; 1777 + // } 1778 + // else if (TeleTrusTObjectIdentifiers.ripemd256.equals(digestAlgOID)) 1779 + // { 1780 + // return "RIPEMD256"; 1781 + // } 1782 + // else if (CryptoProObjectIdentifiers.gostR3411.equals(digestAlgOID)) 1783 + // { 1784 + // return "GOST3411"; 1785 + // } 1786 + // END android-removed 1787 else 1788 { 1789 return digestAlgOID.getId(); 1790