mirror of
https://github.com/QuasarApp/qca.git
synced 2025-04-26 11:34:32 +00:00
Enable a clazy CI
Starting with only missing-qobject-macro check enabled
This commit is contained in:
parent
7df8f7e215
commit
dce16514fe
@ -11,3 +11,16 @@ build_ubuntu_18_04:
|
||||
- cmake -G Ninja ..
|
||||
- ninja
|
||||
- ctest
|
||||
|
||||
build_clazy:
|
||||
stage: build
|
||||
image: debian:unstable
|
||||
before_script:
|
||||
- echo 'deb-src http://deb.debian.org/debian unstable main' >> /etc/apt/sources.list
|
||||
- apt-get update
|
||||
- apt-get build-dep --yes --no-install-recommends qca2
|
||||
- apt-get install --yes --no-install-recommends ninja-build libbotan-2-dev libnss3-dev libgcrypt20-dev libpkcs11-helper1-dev clazy clang
|
||||
script:
|
||||
- mkdir -p build && cd build
|
||||
- CC=clang CXX=clazy CXXFLAGS="-Werror -Wno-deprecated-declarations" cmake -G Ninja ..
|
||||
- CLAZY_CHECKS="missing-qobject-macro" ninja
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
class AESCMACContext : public QCA::MACContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AESCMACContext(QCA::Provider *p) : QCA::MACContext(p, "cmac(aes)")
|
||||
{
|
||||
@ -316,3 +317,4 @@ int main(int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "aes-cmac.moc"
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
class TLSSocket : public QTcpSocket
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TLSSocket(QObject *parent = nullptr);
|
||||
~TLSSocket();
|
||||
|
@ -39,6 +39,7 @@
|
||||
//-----------------------------------------------------------
|
||||
class botanRandomContext : public QCA::RandomContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
botanRandomContext(QCA::Provider *p) : RandomContext(p)
|
||||
{
|
||||
@ -83,6 +84,7 @@ static QString qcaHashToBotanHash(const QString &type)
|
||||
//-----------------------------------------------------------
|
||||
class BotanHashContext : public QCA::HashContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BotanHashContext( QCA::Provider *p, const QString &type) : QCA::HashContext(p, type)
|
||||
{
|
||||
@ -147,6 +149,7 @@ static QString qcaHmacToBotanHmac(const QString &type)
|
||||
//-----------------------------------------------------------
|
||||
class BotanHMACContext : public QCA::MACContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BotanHMACContext(QCA::Provider *p, const QString &type) : QCA::MACContext(p, type)
|
||||
{
|
||||
@ -218,6 +221,7 @@ static QString qcaPbkdfToBotanPbkdf(const QString &pbkdf)
|
||||
//-----------------------------------------------------------
|
||||
class BotanPBKDFContext: public QCA::KDFContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BotanPBKDFContext( QCA::Provider *p, const QString &type) : QCA::KDFContext(p, type)
|
||||
{
|
||||
@ -295,6 +299,7 @@ static QString qcaHkdfToBotanHkdf(const QString &type)
|
||||
//-----------------------------------------------------------
|
||||
class BotanHKDFContext: public QCA::HKDFContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BotanHKDFContext(QCA::Provider *p, const QString &type) : QCA::HKDFContext(p, type)
|
||||
{
|
||||
@ -435,6 +440,7 @@ static void qcaCipherToBotanCipher(const QString &type, std::string *algoName, s
|
||||
//-----------------------------------------------------------
|
||||
class BotanCipherContext : public QCA::CipherContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BotanCipherContext( QCA::Provider *p, const QString &type) : QCA::CipherContext(p, type)
|
||||
{
|
||||
|
@ -213,6 +213,7 @@ static QString addrString(const SASLContext::HostPort &hp)
|
||||
|
||||
class saslContext : public SASLContext
|
||||
{
|
||||
Q_OBJECT
|
||||
saslProvider *g;
|
||||
|
||||
// core props
|
||||
|
@ -44,6 +44,7 @@ void check_error( const QString &label, gcry_error_t err )
|
||||
|
||||
class gcryHashContext : public QCA::HashContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
gcryHashContext(int hashAlgorithm, QCA::Provider *p, const QString &type) : QCA::HashContext(p, type)
|
||||
{
|
||||
@ -93,6 +94,7 @@ protected:
|
||||
|
||||
class gcryHMACContext : public QCA::MACContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
gcryHMACContext(int hashAlgorithm, QCA::Provider *p, const QString &type) : QCA::MACContext(p, type)
|
||||
{
|
||||
@ -153,6 +155,7 @@ protected:
|
||||
|
||||
class gcryCipherContext : public QCA::CipherContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
gcryCipherContext(int algorithm, int mode, bool pad, QCA::Provider *p, const QString &type) : QCA::CipherContext(p, type)
|
||||
{
|
||||
@ -271,6 +274,7 @@ protected:
|
||||
|
||||
class pbkdf1Context : public QCA::KDFContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
pbkdf1Context(int algorithm, QCA::Provider *p, const QString &type) : QCA::KDFContext(p, type)
|
||||
{
|
||||
@ -415,6 +419,7 @@ protected:
|
||||
|
||||
class pbkdf2Context : public QCA::KDFContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
pbkdf2Context(int algorithm, QCA::Provider *p, const QString &type) : QCA::KDFContext(p, type)
|
||||
{
|
||||
|
@ -27,6 +27,7 @@ class MyKeyStoreList;
|
||||
|
||||
class MyKeyStoreEntry : public QCA::KeyStoreEntryContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QCA::KeyStoreEntry::Type item_type;
|
||||
QCA::PGPKey pub, sec;
|
||||
|
@ -25,6 +25,7 @@ namespace gpgQCAPlugin
|
||||
|
||||
class MyOpenPGPContext : public QCA::SMSContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MyOpenPGPContext(QCA::Provider *p);
|
||||
|
||||
|
@ -27,6 +27,7 @@ namespace gpgQCAPlugin
|
||||
|
||||
class MyPGPKeyContext : public QCA::PGPKeyContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QCA::PGPKeyContextProps _props;
|
||||
|
||||
|
@ -31,6 +31,7 @@ namespace loggerQCAPlugin {
|
||||
|
||||
class StreamLogger : public QCA::AbstractLogDevice
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
StreamLogger(QTextStream &stream) : QCA::AbstractLogDevice( "Stream logger" ), _stream(stream)
|
||||
{
|
||||
|
@ -30,6 +30,7 @@
|
||||
//-----------------------------------------------------------
|
||||
class nssHashContext : public QCA::HashContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
nssHashContext( QCA::Provider *p, const QString &type) : QCA::HashContext(p, type)
|
||||
{
|
||||
@ -139,6 +140,7 @@ private:
|
||||
//-----------------------------------------------------------
|
||||
class nssHmacContext : public QCA::MACContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
nssHmacContext( QCA::Provider *p, const QString &type) : QCA::MACContext(p, type)
|
||||
{
|
||||
@ -273,6 +275,7 @@ private:
|
||||
//-----------------------------------------------------------
|
||||
class nssCipherContext : public QCA::CipherContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
nssCipherContext( QCA::Provider *p, const QString &type) : QCA::CipherContext(p, type)
|
||||
{
|
||||
|
@ -1031,6 +1031,7 @@ EVP_PKEY *qca_d2i_PKCS8PrivateKey(const SecureArray &in, EVP_PKEY **x, pem_passw
|
||||
|
||||
class opensslHashContext : public HashContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
opensslHashContext(const EVP_MD *algorithm, Provider *p, const QString &type) : HashContext(p, type)
|
||||
{
|
||||
@ -1084,6 +1085,7 @@ protected:
|
||||
|
||||
class opensslPbkdf1Context : public KDFContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
opensslPbkdf1Context(const EVP_MD *algorithm, Provider *p, const QString &type) : KDFContext(p, type)
|
||||
{
|
||||
@ -1223,6 +1225,7 @@ protected:
|
||||
|
||||
class opensslPbkdf2Context : public KDFContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
opensslPbkdf2Context(Provider *p, const QString &type) : KDFContext(p, type)
|
||||
{
|
||||
@ -1283,6 +1286,7 @@ protected:
|
||||
#ifdef OSSL_110
|
||||
class opensslHkdfContext : public HKDFContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
opensslHkdfContext(Provider *p, const QString &type) : HKDFContext(p, type)
|
||||
{
|
||||
@ -1313,6 +1317,7 @@ public:
|
||||
|
||||
class opensslHMACContext : public MACContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
opensslHMACContext(const EVP_MD *algorithm, Provider *p, const QString &type) : MACContext(p, type)
|
||||
{
|
||||
@ -3003,6 +3008,7 @@ static RSA *createFromExisting(const RSAPrivateKey &key)
|
||||
//----------------------------------------------------------------------------
|
||||
class MyPKeyContext : public PKeyContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PKeyBase *k;
|
||||
|
||||
@ -3495,6 +3501,7 @@ static bool sameChain(STACK_OF(X509) *ossl, const QList<const MyCertContext*> &q
|
||||
// TODO: support read/write of multiple info values with the same name
|
||||
class MyCertContext : public CertContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
X509Item item;
|
||||
CertContextProps _props;
|
||||
@ -3926,6 +3933,7 @@ bool sameChain(STACK_OF(X509) *ossl, const QList<const MyCertContext*> &qca)
|
||||
// Thanks to Pascal Patry
|
||||
class MyCAContext : public CAContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
X509Item caCert;
|
||||
MyPKeyContext *privateKey;
|
||||
@ -4094,6 +4102,7 @@ public:
|
||||
//----------------------------------------------------------------------------
|
||||
class MyCSRContext : public CSRContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
X509Item item;
|
||||
CertContextProps _props;
|
||||
@ -4381,6 +4390,7 @@ public:
|
||||
//----------------------------------------------------------------------------
|
||||
class MyCRLContext : public CRLContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
X509Item item;
|
||||
CRLContextProps _props;
|
||||
@ -4883,6 +4893,7 @@ Validity MyCertContext::validate_chain(const QList<CertContext*> &chain, const Q
|
||||
|
||||
class MyPKCS12Context : public PKCS12Context
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MyPKCS12Context(Provider *p) : PKCS12Context(p)
|
||||
{
|
||||
@ -5551,6 +5562,7 @@ static QString cipherIDtoString( const TLS::Version &version, const unsigned lon
|
||||
static bool ssl_init = false;
|
||||
class MyTLSContext : public TLSContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum { Good, TryAgain, Bad };
|
||||
enum { Idle, Connect, Accept, Handshake, Active, Closing };
|
||||
@ -6355,6 +6367,7 @@ public:
|
||||
|
||||
class CMSContext : public SMSContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CertificateCollection trustedCerts;
|
||||
CertificateCollection untrustedCerts;
|
||||
@ -6992,6 +7005,7 @@ MessageContext *CMSContext::createMessage()
|
||||
|
||||
class opensslCipherContext : public CipherContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
opensslCipherContext(const EVP_CIPHER *algorithm, const int pad, Provider *p, const QString &type) : CipherContext(p, type)
|
||||
{
|
||||
@ -7316,6 +7330,7 @@ public:
|
||||
|
||||
class opensslRandomContext : public RandomContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
opensslRandomContext(QCA::Provider *p) : RandomContext(p)
|
||||
{
|
||||
|
@ -1042,6 +1042,7 @@ private:
|
||||
//----------------------------------------------------------------------------
|
||||
class pkcs11PKeyContext : public PKeyContext
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
PKeyBase *_k;
|
||||
@ -1195,6 +1196,7 @@ public:
|
||||
//----------------------------------------------------------------------------
|
||||
class pkcs11KeyStoreEntryContext : public KeyStoreEntryContext
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
KeyStoreEntry::Type _item_type;
|
||||
KeyBundle _key;
|
||||
|
@ -475,6 +475,7 @@ public:
|
||||
|
||||
class softstorePKeyContext : public PKeyContext
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
PKeyBase *_k;
|
||||
@ -625,6 +626,7 @@ public:
|
||||
|
||||
class softstoreKeyStoreEntryContext : public KeyStoreEntryContext
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
KeyStoreEntry::Type _item_type;
|
||||
KeyBundle _key;
|
||||
|
@ -2124,6 +2124,7 @@ public Q_SLOTS:
|
||||
|
||||
class PasswordAsker::Private : public AskerPrivate
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Private(PasswordAsker *_q) : AskerPrivate(_q)
|
||||
{
|
||||
@ -2185,6 +2186,7 @@ SecureArray PasswordAsker::password() const
|
||||
//----------------------------------------------------------------------------
|
||||
class TokenAsker::Private : public AskerPrivate
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Private(TokenAsker *_q) : AskerPrivate(_q)
|
||||
{
|
||||
|
@ -87,6 +87,7 @@ public:
|
||||
//----------------------------------------------------------------------------
|
||||
class DefaultRandomContext : public RandomContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DefaultRandomContext(Provider *p) : RandomContext(p) {}
|
||||
|
||||
@ -512,6 +513,7 @@ md5_finish(md5_state_t *pms, md5_byte_t digest[16])
|
||||
|
||||
class DefaultMD5Context : public HashContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DefaultMD5Context(Provider *p) : HashContext(p, "md5")
|
||||
{
|
||||
@ -609,6 +611,7 @@ typedef union {
|
||||
|
||||
class DefaultSHA1Context : public HashContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SHA1_CONTEXT _context;
|
||||
#ifdef Q_PROCESSOR_ARM
|
||||
@ -905,6 +908,7 @@ static bool entry_deserialize(const QString &in, QString *storeId, QString *stor
|
||||
|
||||
class DefaultKeyStoreEntry : public KeyStoreEntryContext
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KeyStoreEntry::Type _type;
|
||||
QString _id, _name, _storeId, _storeName;
|
||||
|
@ -75,6 +75,7 @@ static QStringList wrapstring(const QString &str, int width)
|
||||
|
||||
class StreamLogger : public QCA::AbstractLogDevice
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
StreamLogger(QTextStream &stream) : QCA::AbstractLogDevice( "Stream logger" ), _stream(stream)
|
||||
{
|
||||
@ -681,6 +682,7 @@ private Q_SLOTS:
|
||||
|
||||
class PassphrasePromptThread : public QCA::SyncThread
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PassphrasePrompt *pp;
|
||||
|
||||
|
@ -48,6 +48,7 @@ private:
|
||||
|
||||
class NullLogger : public QCA::AbstractLogDevice
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
NullLogger() : QCA::AbstractLogDevice( "null logger" )
|
||||
{}
|
||||
@ -58,6 +59,7 @@ public:
|
||||
|
||||
class LastLogger : public QCA::AbstractLogDevice
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
LastLogger() : QCA::AbstractLogDevice( "last logger" )
|
||||
{}
|
||||
|
Loading…
x
Reference in New Issue
Block a user