diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-03-16 12:41:05 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-03-16 12:41:05 +0700 |
commit | fdeafa10e2dcfee734d050f2f11ab50a350f69cc (patch) | |
tree | b839357e0bea77bf7c192671b77539b9051162a0 /crypto/src/x509 | |
parent | Fix non-8-aligned IPv4 netmask parsing (diff) | |
download | BouncyCastle.NET-ed25519-fdeafa10e2dcfee734d050f2f11ab50a350f69cc.tar.xz |
Fix rethrow syntax
- see https://github.com/bcgit/bc-csharp/issues/425
Diffstat (limited to 'crypto/src/x509')
-rw-r--r-- | crypto/src/x509/X509AttrCertParser.cs | 4 | ||||
-rw-r--r-- | crypto/src/x509/X509CertPairParser.cs | 4 | ||||
-rw-r--r-- | crypto/src/x509/X509CertificateParser.cs | 4 | ||||
-rw-r--r-- | crypto/src/x509/X509CrlParser.cs | 4 | ||||
-rw-r--r-- | crypto/src/x509/X509V2AttributeCertificate.cs | 4 |
5 files changed, 16 insertions, 4 deletions
diff --git a/crypto/src/x509/X509AttrCertParser.cs b/crypto/src/x509/X509AttrCertParser.cs index 0019a48eb..39727a0e2 100644 --- a/crypto/src/x509/X509AttrCertParser.cs +++ b/crypto/src/x509/X509AttrCertParser.cs @@ -141,6 +141,10 @@ namespace Org.BouncyCastle.X509 return ReadDerCertificate(new Asn1InputStream(inStream)); } + catch (CertificateException) + { + throw; + } catch (Exception e) { throw new CertificateException(e.ToString()); diff --git a/crypto/src/x509/X509CertPairParser.cs b/crypto/src/x509/X509CertPairParser.cs index 95ba522c8..d8ecd9ddf 100644 --- a/crypto/src/x509/X509CertPairParser.cs +++ b/crypto/src/x509/X509CertPairParser.cs @@ -74,6 +74,10 @@ namespace Org.BouncyCastle.X509 return ReadDerCrossCertificatePair(inStream); } + catch (CertificateException) + { + throw; + } catch (Exception e) { throw new CertificateException(e.ToString()); diff --git a/crypto/src/x509/X509CertificateParser.cs b/crypto/src/x509/X509CertificateParser.cs index 6fc1b3ff4..2d6da0f23 100644 --- a/crypto/src/x509/X509CertificateParser.cs +++ b/crypto/src/x509/X509CertificateParser.cs @@ -143,6 +143,10 @@ namespace Org.BouncyCastle.X509 return ReadDerCertificate(asn1In); } } + catch (CertificateException) + { + throw; + } catch (Exception e) { throw new CertificateException("Failed to read certificate", e); diff --git a/crypto/src/x509/X509CrlParser.cs b/crypto/src/x509/X509CrlParser.cs index 53a02393b..040943104 100644 --- a/crypto/src/x509/X509CrlParser.cs +++ b/crypto/src/x509/X509CrlParser.cs @@ -138,9 +138,9 @@ namespace Org.BouncyCastle.X509 return ReadDerCrl(asn1); } } - catch (CrlException e) + catch (CrlException) { - throw e; + throw; } catch (Exception e) { diff --git a/crypto/src/x509/X509V2AttributeCertificate.cs b/crypto/src/x509/X509V2AttributeCertificate.cs index b5a316d76..836213fdc 100644 --- a/crypto/src/x509/X509V2AttributeCertificate.cs +++ b/crypto/src/x509/X509V2AttributeCertificate.cs @@ -27,9 +27,9 @@ namespace Org.BouncyCastle.X509 { return AttributeCertificate.GetInstance(Asn1Object.FromStream(input)); } - catch (IOException e) + catch (IOException) { - throw e; + throw; } catch (Exception e) { |