Skip to content

Commit a7d9325

Browse files
committed
Don't re-wrap CMSException in JceKeyAgreeRecipient
A CMSException raised while recovering the session key now reaches the caller as is, rather than wrapped as "originator key invalid.", e.g. the unsupported originator identifier case.
1 parent 33a86f7 commit a7d9325

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎pkix/src/main/java/org/bouncycastle/cms/jcajce/JceKeyAgreeRecipient.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,10 @@ protected Key extractSecretKey(AlgorithmIdentifier keyEncryptionAlgorithm, Algor
370370
{
371371
throw new CMSException("required padding not supported.", e);
372372
}
373+
catch (CMSException e)
374+
{
375+
throw e;
376+
}
373377
catch (Exception e)
374378
{
375379
throw new CMSException("originator key invalid.", e);

‎pkix/src/main/jdk1.1/org/bouncycastle/cms/jcajce/JceKeyAgreeRecipient.java‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,10 @@ protected Key extractSecretKey(AlgorithmIdentifier keyEncryptionAlgorithm, Algor
301301
{
302302
throw new CMSException("required padding not supported.", e);
303303
}
304+
catch (CMSException e)
305+
{
306+
throw e;
307+
}
304308
catch (Exception e)
305309
{
306310
throw new CMSException("originator key invalid.", e);

0 commit comments

Comments
 (0)