From 9b9414e8c9956f8a4daeaf033e4d56e73040cecd Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 25 Jul 2023 16:28:44 +0700 Subject: Warnings cleanup --- crypto/src/asn1/tsp/ArchiveTimeStamp.cs | 8 ++++---- crypto/src/asn1/tsp/ArchiveTimeStampChain.cs | 4 ++-- crypto/src/asn1/tsp/ArchiveTimeStampSequence.cs | 4 ++-- crypto/src/asn1/tsp/CryptoInfos.cs | 2 +- crypto/src/asn1/tsp/EncryptionInfo.cs | 12 ++++++------ crypto/src/asn1/tsp/EvidenceRecord.cs | 2 +- crypto/src/asn1/tsp/PartialHashtree.cs | 11 +++-------- crypto/src/crypto/engines/RFC3394WrapEngine.cs | 2 +- crypto/src/crypto/engines/Rfc5649WrapEngine.cs | 2 +- crypto/src/pqc/crypto/utils/PqcPublicKeyFactory.cs | 8 ++++---- 10 files changed, 25 insertions(+), 30 deletions(-) (limited to 'crypto') diff --git a/crypto/src/asn1/tsp/ArchiveTimeStamp.cs b/crypto/src/asn1/tsp/ArchiveTimeStamp.cs index 57cc02138..dbc426bc8 100644 --- a/crypto/src/asn1/tsp/ArchiveTimeStamp.cs +++ b/crypto/src/asn1/tsp/ArchiveTimeStamp.cs @@ -8,17 +8,17 @@ namespace Org.BouncyCastle.Asn1.Tsp /** * Implementation of the Archive Timestamp type defined in RFC4998. * @see RFC 4998 - *

+ *

* ASN.1 Archive Timestamp - *

+ *

* ArchiveTimeStamp ::= SEQUENCE { * digestAlgorithm [Ø] AlgorithmIdentifier OPTIONAL, * attributes [1] Attributes OPTIONAL, * reducedHashtree [2] SEQUENCE OF PartialHashtree OPTIONAL, * timeStamp ContentInfo} - *

+ *

* PartialHashtree ::= SEQUENCE OF OCTET STRING - *

+ *

* Attributes ::= SET SIZE (1..MAX) OF Attribute */ public class ArchiveTimeStamp diff --git a/crypto/src/asn1/tsp/ArchiveTimeStampChain.cs b/crypto/src/asn1/tsp/ArchiveTimeStampChain.cs index 13138d6f9..6d274cf58 100644 --- a/crypto/src/asn1/tsp/ArchiveTimeStampChain.cs +++ b/crypto/src/asn1/tsp/ArchiveTimeStampChain.cs @@ -4,10 +4,10 @@ namespace Org.BouncyCastle.Asn1.Tsp { /** * Implementation of ArchiveTimeStampChain type, as defined in RFC4998 and RFC6283. - *

+ *

* An ArchiveTimeStampChain corresponds to a SEQUENCE OF ArchiveTimeStamps, and has the following * ASN.1 Syntax: - *

+ *

* ArchiveTimeStampChain ::= SEQUENCE OF ArchiveTimeStamp */ public class ArchiveTimeStampChain diff --git a/crypto/src/asn1/tsp/ArchiveTimeStampSequence.cs b/crypto/src/asn1/tsp/ArchiveTimeStampSequence.cs index 766f6704c..3c5d963e6 100644 --- a/crypto/src/asn1/tsp/ArchiveTimeStampSequence.cs +++ b/crypto/src/asn1/tsp/ArchiveTimeStampSequence.cs @@ -4,10 +4,10 @@ namespace Org.BouncyCastle.Asn1.Tsp { /** * Implementation of ArchiveTimeStampSequence type, as defined in RFC4998. - *

+ *

* An ArchiveTimeStampSequence corresponds to a SEQUENCE OF ArchiveTimeStampChains and has the * following ASN.1 Syntax: - *

+ *

* ArchiveTimeStampSequence ::= SEQUENCE OF ArchiveTimeStampChain */ public class ArchiveTimeStampSequence diff --git a/crypto/src/asn1/tsp/CryptoInfos.cs b/crypto/src/asn1/tsp/CryptoInfos.cs index b0b84c014..b99afad76 100644 --- a/crypto/src/asn1/tsp/CryptoInfos.cs +++ b/crypto/src/asn1/tsp/CryptoInfos.cs @@ -4,7 +4,7 @@ namespace Org.BouncyCastle.Asn1.Tsp { /** * Implementation of the CryptoInfos element defined in RFC 4998: - *

+ *

* CryptoInfos ::= SEQUENCE SIZE (1..MAX) OF Attribute */ public class CryptoInfos diff --git a/crypto/src/asn1/tsp/EncryptionInfo.cs b/crypto/src/asn1/tsp/EncryptionInfo.cs index e712c6a00..d8e285a0c 100644 --- a/crypto/src/asn1/tsp/EncryptionInfo.cs +++ b/crypto/src/asn1/tsp/EncryptionInfo.cs @@ -4,25 +4,25 @@ namespace Org.BouncyCastle.Asn1.Tsp { /** * Implementation of the EncryptionInfo element defined in RFC 4998: - *

+ *

* 1988 ASN.1 EncryptionInfo - *

+ *

* EncryptionInfo ::= SEQUENCE { * encryptionInfoType OBJECT IDENTIFIER, * encryptionInfoValue ANY DEFINED BY encryptionInfoType * } - *

+ *

* 1997-ASN.1 EncryptionInfo - *

+ *

* EncryptionInfo ::= SEQUENCE { * encryptionInfoType ENCINFO-TYPE.&id * ({SupportedEncryptionAlgorithms}), * encryptionInfoValue ENCINFO-TYPE.&Type * ({SupportedEncryptionAlgorithms}{@encryptionInfoType}) * } - *

+ *

* ENCINFO-TYPE ::= TYPE-IDENTIFIER - *

+ *

* SupportedEncryptionAlgorithms ENCINFO-TYPE ::= {...} */ public class EncryptionInfo diff --git a/crypto/src/asn1/tsp/EvidenceRecord.cs b/crypto/src/asn1/tsp/EvidenceRecord.cs index 42ec4bf16..1be8a3998 100644 --- a/crypto/src/asn1/tsp/EvidenceRecord.cs +++ b/crypto/src/asn1/tsp/EvidenceRecord.cs @@ -8,7 +8,7 @@ namespace Org.BouncyCastle.Asn1.Tsp /** * RFC 4998: * Evidence Record Syntax (ERS) - *

+ *

*

      * EvidenceRecord ::= SEQUENCE {
      *   version                   INTEGER { v1(1) } ,
diff --git a/crypto/src/asn1/tsp/PartialHashtree.cs b/crypto/src/asn1/tsp/PartialHashtree.cs
index a32a9f18b..dea7c9e37 100644
--- a/crypto/src/asn1/tsp/PartialHashtree.cs
+++ b/crypto/src/asn1/tsp/PartialHashtree.cs
@@ -7,9 +7,9 @@ namespace Org.BouncyCastle.Asn1.Tsp
 {
     /**
      * Implementation of PartialHashtree, as defined in RFC 4998.
-     * 

+ *

* The ASN.1 notation for a PartialHashTree is: - *

+ *

* PartialHashtree ::= SEQUENCE OF OCTET STRING */ public class PartialHashtree @@ -51,12 +51,7 @@ namespace Org.BouncyCastle.Asn1.Tsp m_values = values; } - public PartialHashtree(byte[] value) - { - m_values = new DerSequence(new DerOctetString(Arrays.Clone(value))); - } - - public PartialHashtree(byte[][] values) + public PartialHashtree(params byte[][] values) { Asn1EncodableVector v = new Asn1EncodableVector(values.Length); diff --git a/crypto/src/crypto/engines/RFC3394WrapEngine.cs b/crypto/src/crypto/engines/RFC3394WrapEngine.cs index 5713bb08a..c0f2b3237 100644 --- a/crypto/src/crypto/engines/RFC3394WrapEngine.cs +++ b/crypto/src/crypto/engines/RFC3394WrapEngine.cs @@ -8,7 +8,7 @@ namespace Org.BouncyCastle.Crypto.Engines ///

An implementation of the AES Key Wrap with Padding specification as described in RFC 3349. /// /// For further details see: Schaad, J. and R. Housley, "Advanced Encryption Standard (AES) Key Wrap Algorithm", - /// RFC 3394, DOI 10.17487/RFC3394, September 2002, , and + /// RFC 3394, DOI 10.17487/RFC3394, September 2002, <https://www.rfc-editor.org/info/rfc3394\>, and /// http://csrc.nist.gov/encryption/kms/key-wrap.pdf. /// public class Rfc3394WrapEngine diff --git a/crypto/src/crypto/engines/Rfc5649WrapEngine.cs b/crypto/src/crypto/engines/Rfc5649WrapEngine.cs index 09830c7e8..354879913 100644 --- a/crypto/src/crypto/engines/Rfc5649WrapEngine.cs +++ b/crypto/src/crypto/engines/Rfc5649WrapEngine.cs @@ -9,7 +9,7 @@ namespace Org.BouncyCastle.Crypto.Engines /// An implementation of the AES Key Wrap with Padding specification as described in RFC 5649. /// /// For further details see: Housley, R. and M. Dworkin, "Advanced Encryption Standard (AES) Key Wrap with Padding Algorithm", - /// RFC 5649, DOI 10.17487/RFC5649, September 2009, , and + /// RFC 5649, DOI 10.17487/RFC5649, September 2009, <https://www.rfc-editor.org/info/rfc5649>, and /// http://csrc.nist.gov/encryption/kms/key-wrap.pdf. /// public class Rfc5649WrapEngine diff --git a/crypto/src/pqc/crypto/utils/PqcPublicKeyFactory.cs b/crypto/src/pqc/crypto/utils/PqcPublicKeyFactory.cs index 77af73b41..5dcd7ab0c 100644 --- a/crypto/src/pqc/crypto/utils/PqcPublicKeyFactory.cs +++ b/crypto/src/pqc/crypto/utils/PqcPublicKeyFactory.cs @@ -411,9 +411,9 @@ namespace Org.BouncyCastle.Pqc.Crypto.Utilities return new BikePublicKeyParameters(bikeParams, keyEnc); } - catch (Exception e) + catch (Exception) { - byte[] keyEnc = keyInfo.PublicKeyData.GetOctets(); + byte[] keyEnc = keyInfo.PublicKey.GetOctets(); BikeParameters bikeParams = PqcUtilities.BikeParamsLookup(keyInfo.Algorithm.Algorithm); @@ -434,10 +434,10 @@ namespace Org.BouncyCastle.Pqc.Crypto.Utilities return new HqcPublicKeyParameters(hqcParams, keyEnc); } - catch (Exception e) + catch (Exception) { // raw encoding - byte[] keyEnc = keyInfo.PublicKeyData.GetOctets(); + byte[] keyEnc = keyInfo.PublicKey.GetOctets(); HqcParameters hqcParams = PqcUtilities.HqcParamsLookup(keyInfo.Algorithm.Algorithm); -- cgit 1.4.1