Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 941294 Details for
Bug 1146666
pdfbox 1.8.7 is available
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
port to bouncycastle 1.50
pdfbox-1.8.7-port-to-bouncycastle1.50.patch (text/plain), 4.08 KB, created by
gil cattaneo
on 2014-09-25 23:43:31 UTC
(
hide
)
Description:
port to bouncycastle 1.50
Filename:
MIME Type:
Creator:
gil cattaneo
Created:
2014-09-25 23:43:31 UTC
Size:
4.08 KB
patch
obsolete
>--- pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java 2014-09-15 20:27:30.000000000 +0200 >+++ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/PublicKeySecurityHandler.java-gil 2014-09-26 01:31:09.514029829 +0200 >@@ -27,6 +27,7 @@ > import java.security.MessageDigest; > import java.security.NoSuchAlgorithmException; > import java.security.NoSuchProviderException; >+import java.security.PrivateKey; > import java.security.SecureRandom; > import java.security.Security; > import java.security.cert.X509Certificate; >@@ -39,7 +40,8 @@ > import org.apache.commons.logging.LogFactory; > > import org.bouncycastle.asn1.ASN1InputStream; >-import org.bouncycastle.asn1.DERObject; >+import org.bouncycastle.asn1.ASN1Primitive; >+import org.bouncycastle.asn1.ASN1Set; > import org.bouncycastle.asn1.DERObjectIdentifier; > import org.bouncycastle.asn1.DEROctetString; > import org.bouncycastle.asn1.DEROutputStream; >@@ -51,6 +53,7 @@ > import org.bouncycastle.asn1.cms.KeyTransRecipientInfo; > import org.bouncycastle.asn1.cms.RecipientIdentifier; > import org.bouncycastle.asn1.cms.RecipientInfo; >+import org.bouncycastle.cms.jcajce.JceKeyTransEnvelopedRecipient; > import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers; > import org.bouncycastle.asn1.x509.AlgorithmIdentifier; > import org.bouncycastle.asn1.x509.TBSCertificateStructure; >@@ -191,7 +194,7 @@ > if(ri.getRID().match(material.getCertificate()) && !foundRecipient) > { > foundRecipient = true; >- envelopedData = ri.getContent(material.getPrivateKey(), "BC"); >+ envelopedData = ri.getContent(new JceKeyTransEnvelopedRecipient((PrivateKey) material.getPrivateKey()).setProvider("BC")); > break; > } > } >@@ -247,10 +250,6 @@ > { > throw new CryptographyException(e); > } >- catch(NoSuchProviderException e) >- { >- throw new CryptographyException(e); >- } > catch(NoSuchAlgorithmException e) > { > throw new CryptographyException(e); >@@ -317,7 +316,7 @@ > pkcs7input[22] = two; > pkcs7input[23] = one; > >- DERObject obj = createDERForRecipient(pkcs7input, certificate); >+ ASN1Primitive obj = createDERForRecipient(pkcs7input, (X509Certificate)certificate); > > ByteArrayOutputStream baos = new ByteArrayOutputStream(); > >@@ -384,7 +383,7 @@ > > } > >- private DERObject createDERForRecipient(byte[] in, X509Certificate cert) >+ private ASN1Primitive createDERForRecipient(byte[] in, X509Certificate cert) > throws IOException, > GeneralSecurityException > { >@@ -395,7 +394,7 @@ > AlgorithmParameters algorithmparameters = algorithmparametergenerator.generateParameters(); > ByteArrayInputStream bytearrayinputstream = new ByteArrayInputStream(algorithmparameters.getEncoded("ASN.1")); > ASN1InputStream asn1inputstream = new ASN1InputStream(bytearrayinputstream); >- DERObject derobject = asn1inputstream.readObject(); >+ ASN1Primitive derobject = asn1inputstream.readObject(); > KeyGenerator keygenerator = KeyGenerator.getInstance(s); > keygenerator.init(128); > SecretKey secretkey = keygenerator.generateKey(); >@@ -408,10 +407,10 @@ > AlgorithmIdentifier algorithmidentifier = new AlgorithmIdentifier(new DERObjectIdentifier(s), derobject); > EncryptedContentInfo encryptedcontentinfo = > new EncryptedContentInfo(PKCSObjectIdentifiers.data, algorithmidentifier, deroctetstring); >- EnvelopedData env = new EnvelopedData(null, derset, encryptedcontentinfo, null); >+ EnvelopedData env = new EnvelopedData(null, derset, encryptedcontentinfo, (ASN1Set) null); > ContentInfo contentinfo = > new ContentInfo(PKCSObjectIdentifiers.envelopedData, env); >- return contentinfo.getDERObject(); >+ return contentinfo.toASN1Primitive(); > } > > private KeyTransRecipientInfo computeRecipientInfo(X509Certificate x509certificate, byte[] abyte0)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1146666
: 941294