Skip to content

Commit

Permalink
Order of initialization for ASN.1 decoders
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Apr 6, 2018
1 parent 62a9574 commit 64a15cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
6 changes: 2 additions & 4 deletions asn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,14 +502,12 @@ lword BERGeneralDecoder::ReduceLength(lword delta)
}

DERGeneralEncoder::DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag)
: ByteQueue(), m_outQueue(outQueue), m_finished(false), m_asnTag(asnTag)
: ByteQueue(), m_outQueue(outQueue), m_asnTag(asnTag), m_finished(false)
{
}

// TODO: GCC (and likely other compilers) identify this as a copy constructor; and not a constructor.
// We have to wait until Crypto++ 6.0 to fix it because the signature change breaks versioning.
DERGeneralEncoder::DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag)
: ByteQueue(), m_outQueue(outQueue), m_finished(false), m_asnTag(asnTag)
: ByteQueue(), m_outQueue(outQueue), m_asnTag(asnTag), m_finished(false)
{
}

Expand Down
5 changes: 0 additions & 5 deletions asn.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,6 @@ class CRYPTOPP_DLL BERGeneralDecoder : public Store
lword ReduceLength(lword delta);
};

// GCC (and likely other compilers) identify the explicit DERGeneralEncoder as a copy constructor;
// and not a constructor. We had to remove the default asnTag value to point the compiler in the
// proper direction. We did not break the library or versioning based on the output of
// `nm --demangle libcryptopp.a | grep DERGeneralEncoder::DERGeneralEncoder | grep -v " U "`.

/// \brief DER General Encoder
class CRYPTOPP_DLL DERGeneralEncoder : public ByteQueue
{
Expand Down

0 comments on commit 64a15cf

Please sign in to comment.