[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,6 +2,6 @@
<service name="tar_git">
<param name="url">https://github.com/monich/harbour-foilauth.git</param>
<param name="branch">master</param>
- <param name="revision">06b83da</param>
+ <param name="revision">4a9e592</param>
</service>
</services>
\ No newline at end of file
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-foilauth-1.1.0.tar.gz/foil/VERSION
^
|
@@ -1 +0,0 @@
-1.0.23
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/app.pro
^
|
@@ -1,10 +1,9 @@
+PREFIX = harbour
NAME = foilauth
openrepos {
- PREFIX = openrepos
DEFINES += OPENREPOS
-} else {
- PREFIX = harbour
+ CONFIG += app_settings
}
TARGET = $${PREFIX}-$${NAME}
@@ -196,23 +195,26 @@
icon_dir = icons/$${s}x$${s}
$${icon_target}.files = $${icon_dir}/$${TARGET}.png
$${icon_target}.path = /usr/share/icons/hicolor/$${s}x$${s}/apps
- equals(PREFIX, "openrepos") {
- $${icon_target}.extra = cp $${icon_dir}/harbour-$${NAME}.png $$eval($${icon_target}.files)
- $${icon_target}.CONFIG += no_check_exist
- }
INSTALLS += $${icon_target}
}
-# Desktop file
-equals(PREFIX, "openrepos") {
- desktop.extra = sed s/harbour/openrepos/g harbour-$${NAME}.desktop > $${TARGET}.desktop
- desktop.CONFIG += no_check_exist
+# Settings
+app_settings {
+ settings_json.files = settings/$${TARGET}.json
+ settings_json.path = /usr/share/jolla-settings/entries/
+ settings_qml.files = settings/*.qml
+ settings_qml.path = /usr/share/$${TARGET}/qml/settings/
+ INSTALLS += settings_qml settings_json
}
+OTHER_FILES += \
+ settings/*.qml \
+ settings/*.json
# Translations
TRANSLATION_IDBASED=-idbased
TRANSLATION_SOURCES = \
- $${_PRO_FILE_PWD_}/qml
+ $${_PRO_FILE_PWD_}/qml \
+ $${_PRO_FILE_PWD_}/settings
defineTest(addTrFile) {
rel = translations/$${1}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/LICENSE
^
|
@@ -1,4 +1,4 @@
-Copyright (C) 2016-2021 by Slava Monich
+Copyright (C) 2016-2022 by Slava Monich
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/debian/changelog
^
|
@@ -1,3 +1,17 @@
+libfoil (1.0.25) unstable; urgency=low
+
+ * Added foil_kdf_pbkdf2()
+
+ -- Slava Monich <slava@monich.com> Sat, 28 May 2022 01:05:31 +0300
+
+libfoil (1.0.24) unstable; urgency=low
+
+ * Added version macros for compile-time version detection
+ * Added foil_version() for run-time version detection
+ * Made internal functions truly internal
+
+ -- Slava Monich <slava@monich.com> Fri, 27 May 2022 14:41:08 +0300
+
libfoil (1.0.23) unstable; urgency=low
* Replaced FoilParsePos with GUtilRange
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/debian/copyright
^
|
@@ -1,4 +1,4 @@
-Copyright (C) 2016-2021 by Slava Monich
+Copyright (C) 2016-2022 by Slava Monich
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/Makefile
^
|
@@ -43,13 +43,30 @@
all: debug release pkgconfig
#
+# Directories
+#
+
+SRC_DIR = src
+IMPL_SRC_DIR = src/$(IMPL)
+INCLUDE_DIR = include
+BUILD_DIR = build
+DEBUG_BUILD_DIR = $(BUILD_DIR)/debug
+RELEASE_BUILD_DIR = $(BUILD_DIR)/release
+COVERAGE_BUILD_DIR = $(BUILD_DIR)/coverage
+IMPL_DEBUG_BUILD_DIR = $(DEBUG_BUILD_DIR)/$(IMPL)
+IMPL_RELEASE_BUILD_DIR = $(RELEASE_BUILD_DIR)/$(IMPL)
+IMPL_COVERAGE_BUILD_DIR = $(COVERAGE_BUILD_DIR)/$(IMPL)
+
+#
# Library version
#
-VERSION_FILE = ../VERSION
-VERSION_MAJOR = $(shell head -1 $(VERSION_FILE) | cut -f1 -d.)
-VERSION_MINOR = $(shell head -1 $(VERSION_FILE) | cut -f2 -d.)
-VERSION_RELEASE = $(shell head -1 $(VERSION_FILE) | cut -f3 -d.)
+VERSION_FILE = $(INCLUDE_DIR)/foil_version.h
+get_version = $(shell grep -E "^ *\\\#define +FOIL_VERSION_$1 +[0-9]+$$" $(VERSION_FILE) | sed "s/ */ /g" | cut -d " " -f 3)
+
+VERSION_MAJOR = $(call get_version,MAJOR)
+VERSION_MINOR = $(call get_version,MINOR)
+VERSION_RELEASE = $(call get_version,RELEASE)
# Version for pkg-config
PCVERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
@@ -90,6 +107,7 @@
foil_input_file.c \
foil_input_mem.c \
foil_input_range.c \
+ foil_kdf.c \
foil_key.c \
foil_key_aes.c \
foil_key_des.c \
@@ -104,7 +122,8 @@
foil_private_key.c \
foil_random.c \
foil_sign.c \
- foil_util.c
+ foil_util.c \
+ foil_version.c
IMPL_SRC = \
foil_openssl_cipher_des_cbc.c \
@@ -124,21 +143,6 @@
foil_openssl_rsa.c
#
-# Directories
-#
-
-SRC_DIR = src
-IMPL_SRC_DIR = src/$(IMPL)
-INCLUDE_DIR = include
-BUILD_DIR = build
-DEBUG_BUILD_DIR = $(BUILD_DIR)/debug
-RELEASE_BUILD_DIR = $(BUILD_DIR)/release
-COVERAGE_BUILD_DIR = $(BUILD_DIR)/coverage
-IMPL_DEBUG_BUILD_DIR = $(DEBUG_BUILD_DIR)/$(IMPL)
-IMPL_RELEASE_BUILD_DIR = $(RELEASE_BUILD_DIR)/$(IMPL)
-IMPL_COVERAGE_BUILD_DIR = $(COVERAGE_BUILD_DIR)/$(IMPL)
-
-#
# Tools and flags
#
@@ -337,7 +341,7 @@
INSTALL_PKGCONFIG_DIR = $(DESTDIR)$(ALIBDIR)/pkgconfig
install: $(INSTALL_LIB_DIR)
- $(INSTALL_FILES) $(RELEASE_SO) $(INSTALL_LIB_DIR)
+ $(INSTALL) -m 755 $(RELEASE_SO) $(INSTALL_LIB_DIR)
ln -sf $(LIB_SO) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK2)
ln -sf $(LIB_SYMLINK2) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK1)
|
[-]
[+]
|
Added |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/include/foil_kdf.h
^
|
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2022 by Slava Monich <slava@monich.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation
+ * are those of the authors and should not be interpreted as representing
+ * any official policies, either expressed or implied.
+ */
+
+#ifndef FOIL_KDF_H
+#define FOIL_KDF_H
+
+#include "foil_types.h"
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+/*
+ * KDF: Key Derivation Functions (RFC 2898)
+ *
+ * Since 1.0.25
+ */
+
+GBytes*
+foil_kdf_pbkdf2(
+ GType digest, /* HMAC digest algorithm, e.g. FOIL_DIGEST_SHA1 */
+ const char* pw, /* UTF-8 encoded password from which to derive the key */
+ gssize pwlen, /* Negative to strlen() the password */
+ const FoilBytes* salt,
+ guint iter, /* Number of iterations */
+ guint dklen); /* Derived key length, zero for auto (digest length) */
+
+G_END_DECLS
+
+#endif /* FOIL_KDF_H */
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/include/foil_types.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2021 by Slava Monich <slava@monich.com>
+ * Copyright (C) 2016-2022 by Slava Monich <slava@monich.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -37,6 +37,8 @@
#include <gutil_types.h>
+#include <foil_version.h>
+
G_BEGIN_DECLS
typedef struct foil_digest FoilDigest;
@@ -44,6 +46,7 @@
typedef struct foil_cmac FoilCmac;
typedef struct foil_hmac FoilHmac;
typedef struct foil_input FoilInput;
+typedef struct foil_kdf FoilKdf; /* Since 1.0.25 */
typedef struct foil_key FoilKey;
typedef struct foil_output FoilOutput;
typedef struct foil_private_key FoilPrivateKey;
|
[-]
[+]
|
Added |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/include/foil_version.h
^
|
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2022 by Slava Monich <slava@monich.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation
+ * are those of the authors and should not be interpreted as representing
+ * any official policies, either expressed or implied.
+ */
+
+#ifndef FOIL_VERSION_H
+#define FOIL_VERSION_H
+
+/*
+ * This header first appeared in version 1.0.24 therefore version checks
+ * in the code which is supposed to be compilable against earlier versions
+ * of libfoil should look like this:
+ *
+ * #if defined(FOIL_CORE_VERSION) && \
+ * FOIL_CORE_VERSION > FOIL_VERSION_WORD(1,0,24)
+ * ...
+ * #endif
+ *
+ * of better like this:
+ *
+ * #ifdef FOIL_VERSION_1_0_24
+ * ...
+ * #endif
+ *
+ * FOIL_VERSION_X_Y_Z macros will be added with each release. The fact that
+ * such macro is defined means that you're compiling against libfoil version
+ * X.Y.Z or greater.
+ */
+
+#define FOIL_VERSION_MAJOR 1
+#define FOIL_VERSION_MINOR 0
+#define FOIL_VERSION_RELEASE 25
+#define FOIL_VERSION_STRING "1.0.25"
+
+/* Version as a single word */
+#define FOIL_VERSION_WORD(v1,v2,v3) \
+ ((((v1) & 0x7f) << 24) | \
+ (((v2) & 0xfff) << 12) | \
+ ((v3) & 0xfff))
+
+#define FOIL_VERSION_GET_MAJOR(v) (((v) >> 24) & 0x7f)
+#define FOIL_VERSION_GET_MINOR(v) (((v) >> 12) & 0xfff)
+#define FOIL_VERSION_GET_RELEASE(v) ((v) & 0xfff)
+
+/*
+ * Function for run-time version detection in case if you're linking
+ * against a dynamic library.
+ */
+unsigned int
+foil_version(
+ void); /* Since 1.0.24 */
+
+/* Current version as a single word */
+#define FOIL_VERSION FOIL_VERSION_WORD \
+ (FOIL_VERSION_MAJOR, FOIL_VERSION_MINOR, FOIL_VERSION_RELEASE)
+
+/* Specific versions */
+#define FOIL_VERSION_1_0_24 FOIL_VERSION_WORD(1,0,24)
+#define FOIL_VERSION_1_0_25 FOIL_VERSION_WORD(1,0,25)
+
+#endif /* FOIL_VERSION_H */
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_cipher_aes.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2019 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -42,7 +42,7 @@
guint8 block[FOIL_AES_BLOCK_SIZE];
} FoilCipherAes;
-GType foil_cipher_aes_get_type(void);
+GType foil_cipher_aes_get_type(void) FOIL_INTERNAL;
#define FOIL_TYPE_CIPHER_AES (foil_cipher_aes_get_type())
#define FOIL_CIPHER_AES(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, \
FOIL_TYPE_CIPHER_AES, FoilCipherAes))
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_cipher_p.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2019 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -85,14 +85,16 @@
foil_cipher_default_padding_func(
guint8* block,
gsize data_size,
- gsize block_size);
+ gsize block_size)
+ FOIL_INTERNAL;
int
foil_cipher_symmetric_finish(
FoilCipher* cipher,
const void* from,
int flen,
- void* to);
+ void* to)
+ FOIL_INTERNAL;
#endif /* FOIL_CIPHER_P_H */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_cipher_sync.h
^
|
@@ -1,26 +1,31 @@
/*
- * Copyright (C) 2016-2017 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * 1.Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2.Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
- * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -46,7 +51,7 @@
gint priority;
} FoilCipherSync;
-GType foil_cipher_sync_get_type(void);
+GType foil_cipher_sync_get_type(void) FOIL_INTERNAL;
#define FOIL_TYPE_CIPHER_SYNC (foil_cipher_sync_get_type())
#define FOIL_CIPHER_SYNC(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, \
FOIL_TYPE_CIPHER_SYNC, FoilCipherSync))
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_digest_p.h
^
|
@@ -1,29 +1,31 @@
/*
- * Copyright (C) 2016-2021 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * 1.Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2.Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the names of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
- * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -66,11 +68,11 @@
typedef FoilDigestClass FoilDigestSHA512Class;
/* Abstract types */
-GType foil_digest_get_type(void);
-GType foil_digest_md5_get_type(void);
-GType foil_digest_sha1_get_type(void);
-GType foil_digest_sha256_get_type(void);
-GType foil_digest_sha512_get_type(void);
+GType foil_digest_get_type(void) FOIL_INTERNAL;
+GType foil_digest_md5_get_type(void) FOIL_INTERNAL;
+GType foil_digest_sha1_get_type(void) FOIL_INTERNAL;
+GType foil_digest_sha256_get_type(void) FOIL_INTERNAL;
+GType foil_digest_sha512_get_type(void) FOIL_INTERNAL;
#define FOIL_TYPE_DIGEST (foil_digest_get_type())
#define FOIL_TYPE_DIGEST_MD5 (foil_digest_md5_get_type())
#define FOIL_TYPE_DIGEST_SHA1 (foil_digest_sha1_get_type())
@@ -84,11 +86,13 @@
gsize
foil_digest_type_block_size(
- GType type);
+ GType type)
+ FOIL_INTERNAL;
gsize
foil_digest_block_size(
- FoilDigest* digest);
+ FoilDigest* digest)
+ FOIL_INTERNAL;
#endif /* FOIL_DIGEST_P_H */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_input_p.h
^
|
@@ -1,26 +1,31 @@
/*
- * Copyright (C) 2016-2017 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * 1.Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2.Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
- * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -30,6 +35,7 @@
#ifndef FOIL_INPUT_P_H
#define FOIL_INPUT_P_H
+#include "foil_types_p.h"
#include "foil_input.h"
typedef struct foil_input_func {
@@ -51,17 +57,20 @@
FoilInput*
foil_input_init(
FoilInput* in,
- const FoilInputFunc* fn);
+ const FoilInputFunc* fn)
+ FOIL_INTERNAL;
void
foil_input_finalize(
- FoilInput* in);
+ FoilInput* in)
+ FOIL_INTERNAL;
void
foil_input_push_back(
FoilInput* in,
const void* buf,
- gsize size);
+ gsize size)
+ FOIL_INTERNAL;
#endif /* FOIL_INPUT_P_H */
|
[-]
[+]
|
Added |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_kdf.c
^
|
@@ -0,0 +1,187 @@
+/*
+ * Copyright (C) 2022 by Slava Monich <slava@monich.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation
+ * are those of the authors and should not be interpreted as representing
+ * any official policies, either expressed or implied.
+ */
+
+#include "foil_kdf.h"
+#include "foil_hmac.h"
+#include "foil_digest.h"
+
+/*
+ * KDF: Key Derivation Functions (RFC 2898)
+ *
+ * Since 1.0.25
+ */
+
+/*
+ * RFC 2898
+ *
+ * 5.2 PBKDF2
+ *
+ * ...
+ *
+ * PBKDF2 (P, S, c, dkLen)
+ *
+ * Options: PRF underlying pseudorandom function (hLen
+ * denotes the length in octets of the
+ * pseudorandom function output)
+ *
+ * Input: P password, an octet string
+ * S salt, an octet string
+ * c iteration count, a positive integer
+ * dkLen intended length in octets of the derived
+ * key, a positive integer, at most
+ * (2^32 - 1) * hLen
+ *
+ * Output: DK derived key, a dkLen-octet string
+ */
+GBytes*
+foil_kdf_pbkdf2(
+ GType digest, /* HMAC digest algorithm, e.g. FOIL_DIGEST_SHA1 */
+ const char* pw, /* UTF-8 encoded password from which to derive the key */
+ gssize pwlen, /* Negative to strlen() the password */
+ const FoilBytes* salt,
+ guint iter, /* Number of iterations */
+ guint dlen) /* Derived key length, zero for auto (digest length) */
+{
+ const gsize hlen = foil_digest_type_size(digest);
+ const gsize dklen = dlen ? dlen : hlen;
+
+ /*
+ * 1. If dkLen > (2^32 - 1) * hLen, output "derived key too long" and
+ * stop. (we skip that because our dlen won't exceed 0xffffffff)
+ */
+ if ((pw || !pwlen) && salt && iter && hlen) {
+ /*
+ * This one must succeed because non-zero hlen guarantees that
+ * the digest type is valid.
+ */
+ FoilHmac* pmac = foil_hmac_new(digest, pw, (pwlen >= 0) ?
+ pwlen : strlen(pw));
+
+ /*
+ * 2. Let l be the number of hLen-octet blocks in the derived key,
+ * rounding up, and let r be the number of octets in the last
+ * block:
+ *
+ * l = CEIL (dkLen / hLen) ,
+ * r = dkLen - (l - 1) * hLen .
+ *
+ * Here, CEIL (x) is the "ceiling" function, i.e. the smallest
+ * integer greater than, or equal to, x.
+ *
+ * 3. For each block of the derived key apply the function F defined
+ * below to the password P, the salt S, the iteration count c, and
+ * the block index to compute the block:
+ *
+ * T_1 = F (P, S, c, 1) ,
+ * T_2 = F (P, S, c, 2) ,
+ * ...
+ * T_l = F (P, S, c, l) ,
+ *
+ * where the function F is defined as the exclusive-or sum of the
+ * first c iterates of the underlying pseudorandom function PRF
+ * applied to the password P and the concatenation of the salt S
+ * and the block index i:
+ *
+ * F (P, S, c, i) = U_1 \xor U_2 \xor ... \xor U_c
+ *
+ * where
+ *
+ * U_1 = PRF (P, S || INT (i)) ,
+ * U_2 = PRF (P, U_1) ,
+ * ...
+ * U_c = PRF (P, U_{c-1}) .
+ *
+ * Here, INT (i) is a four-octet encoding of the integer i, most
+ * significant octet first.
+ */
+ guint8* key = g_malloc(dklen);
+ gsize offset = 0;
+ guint i = 1;
+
+ while (offset < dklen) {
+ const gsize remaining = dklen - offset;
+ const gsize blocklen = MIN(remaining, hlen);
+ const guint32 ibuf = htobe32(i);
+ guint8* block = key + offset;
+ FoilHmac* prf;
+ const guint8* prev;
+ GBytes* prev_bytes;
+ guint m;
+
+ /* U_1 = PRF (P, S || INT (i)) */
+ prf = foil_hmac_clone(pmac);
+ foil_hmac_update(prf, salt->val, salt->len);
+ foil_hmac_update(prf, &ibuf, sizeof(ibuf));
+ prev_bytes = foil_hmac_free_to_bytes(prf);
+ prev = g_bytes_get_data(prev_bytes, NULL);
+ memcpy(block, prev, blocklen);
+
+ for (m = 1; m < iter; m++) {
+ GBytes* next_bytes;
+ const guint8* next;
+ guint k;
+
+ /* U_m = PRF (P, U_{m-1}) */
+ prf = foil_hmac_clone(pmac);
+ foil_hmac_update(prf, prev, hlen);
+ next_bytes = foil_hmac_free_to_bytes(prf);
+ next = g_bytes_get_data(next_bytes, NULL);
+ for (k = 0; k < blocklen; k++) {
+ block[k] ^= next[k];
+ }
+
+ g_bytes_unref(prev_bytes);
+ prev_bytes = next_bytes;
+ prev = next;
+ }
+
+ g_bytes_unref(prev_bytes);
+ offset += blocklen;
+ i++;
+ }
+
+ foil_hmac_unref(pmac);
+ return g_bytes_new_take(key, dklen);
+ } else {
+ return NULL;
+ }
+}
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_key_des_p.h
^
|
@@ -33,8 +33,8 @@
#ifndef FOIL_KEY_DES_P_H
#define FOIL_KEY_DES_P_H
-#include "foil_key_des.h"
#include "foil_key_p.h"
+#include "foil_key_des.h"
typedef struct foil_key_des_class FoilKeyDesClass;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_key_p.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2019 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -71,7 +71,8 @@
foil_key_set_iv(
FoilKey* key,
const void* iv,
- gsize len);
+ gsize len)
+ FOIL_INTERNAL;
#endif /* FOIL_KEY_P_H */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_key_rsa_private.h
^
|
@@ -1,26 +1,31 @@
/*
- * Copyright (C) 2016-2019 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * 1.Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2.Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
- * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -77,7 +82,8 @@
void
foil_key_rsa_private_get_public_data(
FoilKeyRsaPrivate* priv,
- FoilKeyRsaPublicData* pub_data);
+ FoilKeyRsaPublicData* pub_data)
+ FOIL_INTERNAL;
#endif /* FOIL_KEY_PRIVATE_H */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_key_rsa_public.h
^
|
@@ -5,22 +5,27 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * 1.Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2.Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
- * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -58,11 +63,13 @@
void
foil_key_rsa_public_set_data(
FoilKeyRsaPublic* pub,
- const FoilKeyRsaPublicData* data);
+ const FoilKeyRsaPublicData* data)
+ FOIL_INTERNAL;
GBytes*
foil_key_rsa_public_data_fingerprint(
- const FoilKeyRsaPublicData* data);
+ const FoilKeyRsaPublicData* data)
+ FOIL_INTERNAL;
#endif /* FOIL_KEY_PUBLIC_H */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_output_p.h
^
|
@@ -1,26 +1,31 @@
/*
- * Copyright (C) 2016-2017 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * 1.Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2.Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
- * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -30,6 +35,7 @@
#ifndef FOIL_OUTPUT_P_H
#define FOIL_OUTPUT_P_H
+#include "foil_types_p.h"
#include "foil_output.h"
typedef struct foil_output_func {
@@ -51,7 +57,8 @@
FoilOutput*
foil_output_init(
FoilOutput* out,
- const FoilOutputFunc* fn);
+ const FoilOutputFunc* fn)
+ FOIL_INTERNAL;
#endif /* FOIL_OUTPUT_P_H */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_pool.h
^
|
@@ -1,26 +1,31 @@
/*
- * Copyright (C) 2019 by Slava Monich
+ * Copyright (C) 2019-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * 1.Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2.Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
- * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -30,7 +35,7 @@
#ifndef FOIL_POOL_H
#define FOIL_POOL_H
-#include "foil_types.h"
+#include "foil_types_p.h"
typedef struct foil_pool_item FoilPoolItem;
@@ -41,27 +46,32 @@
void
foil_pool_init(
- FoilPool* pool);
+ FoilPool* pool)
+ FOIL_INTERNAL;
void
foil_pool_drain(
- FoilPool* pool);
+ FoilPool* pool)
+ FOIL_INTERNAL;
void
foil_pool_add(
FoilPool* pool,
gpointer pointer,
- GDestroyNotify destroy);
+ GDestroyNotify destroy)
+ FOIL_INTERNAL;
void
foil_pool_add_bytes(
FoilPool* pool,
- GBytes* bytes);
+ GBytes* bytes)
+ FOIL_INTERNAL;
void
foil_pool_add_bytes_ref(
FoilPool* pool,
- GBytes* bytes);
+ GBytes* bytes)
+ FOIL_INTERNAL;
#endif /* FOIL_POOL_H */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_random_p.h
^
|
@@ -1,26 +1,31 @@
/*
- * Copyright (C) 2016 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * 1.Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2.Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
- * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -43,7 +48,7 @@
GObject object;
};
-GType foil_random_get_type(void);
+GType foil_random_get_type(void) FOIL_INTERNAL;
#define FOIL_TYPE_RANDOM (foil_random_get_type())
#define FOIL_RANDOM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
FOIL_TYPE_RANDOM, FoilRandomClass))
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_types_p.h
^
|
@@ -1,26 +1,31 @@
/*
- * Copyright (C) 2016-2019 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * 1.Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2.Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
- * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -38,6 +43,8 @@
typedef struct foil_key_rsa_public_data FoilKeyRsaPublicData;
+#define FOIL_INTERNAL G_GNUC_INTERNAL
+
#define FOIL_ALIGN(x) G_ALIGN4(x)
#define FOIL_BYTES_SET(bytes,data) \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_util_p.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2021 by Slava Monich <slava@monich.com>
+ * Copyright (C) 2016-2022 by Slava Monich <slava@monich.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -35,70 +35,82 @@
#ifndef FOIL_UTIL_P_H
#define FOIL_UTIL_P_H
-#include "foil_util.h"
#include "foil_types_p.h"
+#include "foil_util.h"
guint8*
foil_bytes_copy(
FoilBytes* dest,
const FoilBytes* src,
- guint8* ptr);
+ guint8* ptr)
+ FOIL_INTERNAL;
void
foil_bytes_digest(
FoilBytes* bytes,
- FoilDigest* digest);
+ FoilDigest* digest)
+ FOIL_INTERNAL;
void*
foil_class_ref(
GType type,
- GType base);
+ GType base)
+ FOIL_INTERNAL;
void*
foil_abstract_class_ref(
GType type,
- GType base);
+ GType base)
+ FOIL_INTERNAL;
gsize
foil_parse_init_data(
GUtilRange* pos,
- const FoilBytes* data);
+ const FoilBytes* data)
+ FOIL_INTERNAL;
gsize
foil_parse_init_bytes(
GUtilRange* pos,
- GBytes* bytes);
+ GBytes* bytes)
+ FOIL_INTERNAL;
gsize
foil_parse_init_string(
GUtilRange* pos,
- const char* str);
+ const char* str)
+ FOIL_INTERNAL;
gboolean
foil_parse_skip_to_next_line(
GUtilRange* pos,
- gboolean continued);
+ gboolean continued)
+ FOIL_INTERNAL;
GHashTable*
foil_parse_headers(
GUtilRange* pos,
- GString* buf);
+ GString* buf)
+ FOIL_INTERNAL;
char*
foil_format_header(
const char* tag,
- const char* value);
+ const char* value)
+ FOIL_INTERNAL;
GHashTable*
foil_param_add(
GHashTable* params,
const char* key,
- const char* value);
+ const char* value)
+ FOIL_INTERNAL;
const void*
foil_memmem(
const FoilBytes* haystack,
- const FoilBytes* needle);
+ const FoilBytes* needle)
+ FOIL_INTERNAL;
#endif /* FOIL_UTIL_P_H */
|
[-]
[+]
|
Added |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/foil_version.c
^
|
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2022 by Slava Monich <slava@monich.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation
+ * are those of the authors and should not be interpreted as representing
+ * any official policies, either expressed or implied.
+ */
+
+#include "foil_version.h"
+
+/*
+ * Function for run-time version detection in case if you're linking
+ * against a dynamic library
+ */
+unsigned int
+foil_version() /* Since 1.0.24 */
+{
+ return FOIL_VERSION;
+}
+
+/*
+ * Local Variables:
+ * mode: C
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/openssl/foil_openssl_cipher_aes_decrypt.c
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2019 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -51,6 +51,11 @@
typedef FoilOpensslCipherAesDecrypt FoilOpensslCipherAesCfbDecrypt;
typedef FoilOpensslCipherAesDecrypt FoilOpensslCipherAesEcbDecrypt;
+GType foil_openssl_cipher_aes_decrypt_get_type() FOIL_INTERNAL;
+GType foil_openssl_cipher_aes_cbc_decrypt_get_type() FOIL_INTERNAL;
+GType foil_openssl_cipher_aes_cfb_decrypt_get_type() FOIL_INTERNAL;
+GType foil_openssl_cipher_aes_ecb_decrypt_get_type() FOIL_INTERNAL;
+
G_DEFINE_ABSTRACT_TYPE(FoilOpensslCipherAesDecrypt,
foil_openssl_cipher_aes_decrypt, FOIL_TYPE_CIPHER_AES)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/openssl/foil_openssl_cipher_aes_encrypt.c
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2019 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -47,6 +47,11 @@
typedef FoilOpensslCipherAesEncrypt FoilOpensslCipherAesCfbEncrypt;
typedef FoilOpensslCipherAesEncrypt FoilOpensslCipherAesEcbEncrypt;
+GType foil_openssl_cipher_aes_encrypt_get_type() FOIL_INTERNAL;
+GType foil_openssl_cipher_aes_cbc_encrypt_get_type() FOIL_INTERNAL;
+GType foil_openssl_cipher_aes_cfb_encrypt_get_type() FOIL_INTERNAL;
+GType foil_openssl_cipher_aes_ecb_encrypt_get_type() FOIL_INTERNAL;
+
G_DEFINE_ABSTRACT_TYPE(FoilOpensslCipherAesEncrypt,
foil_openssl_cipher_aes_encrypt, FOIL_TYPE_CIPHER_AES)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/openssl/foil_openssl_cipher_des_cbc.c
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 by Slava Monich
+ * Copyright (C) 2019-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -55,6 +55,10 @@
typedef FoilOpensslCipherDesCbcClass FoilOpensslCipherDesCbcEncryptClass;
typedef FoilOpensslCipherDesCbcClass FoilOpensslCipherDesCbcDecryptClass;
+GType foil_openssl_cipher_des_cbc_get_type() FOIL_INTERNAL;
+GType foil_openssl_cipher_des_cbc_encrypt_get_type() FOIL_INTERNAL;
+GType foil_openssl_cipher_des_cbc_decrypt_get_type() FOIL_INTERNAL;
+
G_DEFINE_ABSTRACT_TYPE(FoilOpensslCipherDesCbc,
foil_openssl_cipher_des_cbc,
FOIL_TYPE_CIPHER_SYNC);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/openssl/foil_openssl_cipher_rsa_decrypt.c
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2019 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -40,6 +40,8 @@
typedef FoilOpensslCipherRsaClass FoilOpensslCipherRsaDecryptClass;
typedef FoilOpensslCipherRsa FoilOpensslCipherRsaDecrypt;
+GType foil_openssl_cipher_rsa_decrypt_get_type() FOIL_INTERNAL;
+
G_DEFINE_TYPE(FoilOpensslCipherRsaDecrypt, foil_openssl_cipher_rsa_decrypt,
FOIL_OPENSSL_TYPE_CIPHER_RSA)
#define FOIL_OPENSSL_TYPE_CIPHER_RSA_DECRYPT \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/openssl/foil_openssl_cipher_rsa_encrypt.c
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2019 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -40,6 +40,8 @@
typedef FoilOpensslCipherRsaClass FoilOpensslCipherRsaEncryptClass;
typedef FoilOpensslCipherRsa FoilOpensslCipherRsaEncrypt;
+GType foil_openssl_cipher_rsa_encrypt_get_type() FOIL_INTERNAL;
+
G_DEFINE_TYPE(FoilOpensslCipherRsaEncrypt, foil_openssl_cipher_rsa_encrypt,
FOIL_OPENSSL_TYPE_CIPHER_RSA)
#define FOIL_OPENSSL_TYPE_CIPHER_RSA_ENCRYPT \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/openssl/foil_openssl_des.h
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 by Slava Monich
+ * Copyright (C) 2019-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -52,7 +52,7 @@
FoilOpensslKeyDesData* k3;
} FoilOpensslKeyDes;
-GType foil_openssl_key_des_get_type(void);
+GType foil_openssl_key_des_get_type(void) FOIL_INTERNAL;
#define FOIL_OPENSSL_TYPE_KEY_DES (foil_openssl_key_des_get_type())
#define FOIL_OPENSSL_KEY_DES(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, \
FOIL_OPENSSL_TYPE_KEY_DES, FoilOpensslKeyDes))
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/openssl/foil_openssl_digest_md5.c
^
|
@@ -1,26 +1,31 @@
/*
- * Copyright (C) 2016-2018 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * 1.Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2.Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
- * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -41,6 +46,8 @@
MD5_CTX ctx;
} FoilOpensslDigestMD5;
+GType foil_openssl_digest_md5_get_type() FOIL_INTERNAL;
+
G_DEFINE_TYPE(FoilOpensslDigestMD5, foil_openssl_digest_md5, \
FOIL_TYPE_DIGEST_MD5)
#define FOIL_OPENSSL_DIGEST_MD5(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/openssl/foil_openssl_digest_sha1.c
^
|
@@ -1,26 +1,31 @@
/*
- * Copyright (C) 2016-2018 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * 1.Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2.Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
- * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -41,6 +46,8 @@
SHA_CTX ctx;
} FoilOpensslDigestSHA1;
+GType foil_openssl_digest_sha1_get_type() FOIL_INTERNAL;
+
G_DEFINE_TYPE(FoilOpensslDigestSHA1, foil_openssl_digest_sha1, \
FOIL_TYPE_DIGEST_SHA1)
#define FOIL_OPENSSL_DIGEST_SHA1(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/openssl/foil_openssl_digest_sha256.c
^
|
@@ -1,26 +1,31 @@
/*
- * Copyright (C) 2016-2018 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * 1.Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2.Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
- * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -41,6 +46,8 @@
SHA256_CTX ctx;
} FoilOpensslDigestSHA256;
+GType foil_openssl_digest_sha256_get_type() FOIL_INTERNAL;
+
G_DEFINE_TYPE(FoilOpensslDigestSHA256, foil_openssl_digest_sha256, \
FOIL_TYPE_DIGEST_SHA256)
#define FOIL_OPENSSL_DIGEST_SHA256(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/openssl/foil_openssl_digest_sha512.c
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 by Slava Monich
+ * Copyright (C) 2021-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -44,6 +44,8 @@
SHA512_CTX ctx;
} FoilOpensslDigestSHA512;
+GType foil_openssl_digest_sha512_get_type() FOIL_INTERNAL;
+
G_DEFINE_TYPE(FoilOpensslDigestSHA512, foil_openssl_digest_sha512, \
FOIL_TYPE_DIGEST_SHA512)
#define FOIL_OPENSSL_DIGEST_SHA512(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/openssl/foil_openssl_random.h
^
|
@@ -1,26 +1,31 @@
/*
- * Copyright (C) 2016-2018 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * 1.Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2.Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
- * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -30,13 +35,14 @@
#ifndef FOIL_OPENSSL_RANDOM_H
#define FOIL_OPENSSL_RANDOM_H
-#include "foil_types.h"
+#include "foil_types_p.h"
#include <glib-object.h>
GType
foil_openssl_random_get_type(
- void);
+ void)
+ FOIL_INTERNAL;
#endif /* FOIL_OPENSSL_RANDOM_H */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/libfoil/src/openssl/foil_openssl_rsa.h
^
|
@@ -1,26 +1,31 @@
/*
- * Copyright (C) 2016-2019 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
- * 1.Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2.Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING
- * IN ANY WAY OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN
- * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
@@ -48,99 +53,117 @@
unsigned char *to, RSA *rsa, int padding);
} FoilOpensslCipherRsa;
-GType foil_openssl_cipher_rsa_get_type(void);
+GType foil_openssl_cipher_rsa_get_type(void) FOIL_INTERNAL;
#define FOIL_OPENSSL_TYPE_CIPHER_RSA foil_openssl_cipher_rsa_get_type()
typedef FoilKeyRsaPrivate FoilOpensslKeyRsaPrivate;
-GType foil_openssl_key_rsa_private_get_type(void);
+GType foil_openssl_key_rsa_private_get_type(void) FOIL_INTERNAL;
#define FOIL_OPENSSL_TYPE_KEY_RSA_PRIVATE \
foil_openssl_key_rsa_private_get_type()
void
foil_openssl_key_rsa_private_apply(
FoilKeyRsaPrivate* priv,
- RSA* rsa);
+ RSA* rsa)
+ FOIL_INTERNAL;
void
foil_openssl_key_rsa_public_apply(
FoilKeyRsaPublic* pub,
- RSA* rsa);
+ RSA* rsa)
+ FOIL_INTERNAL;
/* Getters for RSA fields */
const BIGNUM*
foil_openssl_rsa_get_n(
- const RSA* rsa);
+ const RSA* rsa)
+ FOIL_INTERNAL;
const BIGNUM*
foil_openssl_rsa_get_e(
- const RSA* rsa);
+ const RSA* rsa)
+ FOIL_INTERNAL;
const BIGNUM*
foil_openssl_rsa_get_d(
- const RSA* rsa);
+ const RSA* rsa)
+ FOIL_INTERNAL;
const BIGNUM*
foil_openssl_rsa_get_p(
- const RSA* rsa);
+ const RSA* rsa)
+ FOIL_INTERNAL;
const BIGNUM*
foil_openssl_rsa_get_q(
- const RSA* rsa);
+ const RSA* rsa)
+ FOIL_INTERNAL;
const BIGNUM*
foil_openssl_rsa_get_dmp1(
- const RSA* rsa);
+ const RSA* rsa)
+ FOIL_INTERNAL;
const BIGNUM*
foil_openssl_rsa_get_dmq1(
- const RSA* rsa);
+ const RSA* rsa)
+ FOIL_INTERNAL;
const BIGNUM*
foil_openssl_rsa_get_iqmp(
- const RSA* rsa);
+ const RSA* rsa)
+ FOIL_INTERNAL;
/* Setters for RSA fields */
const BIGNUM*
foil_openssl_rsa_set_n(
RSA* rsa,
- const FoilBytes* bytes);
+ const FoilBytes* bytes)
+ FOIL_INTERNAL;
const BIGNUM*
foil_openssl_rsa_set_e(
RSA* rsa,
- const FoilBytes* bytes);
+ const FoilBytes* bytes)
+ FOIL_INTERNAL;
const BIGNUM*
foil_openssl_rsa_set_d(
RSA* rsa,
- const FoilBytes* bytes);
+ const FoilBytes* bytes)
+ FOIL_INTERNAL;
const BIGNUM*
foil_openssl_rsa_set_p(
RSA* rsa,
- const FoilBytes* bytes);
+ const FoilBytes* bytes)
+ FOIL_INTERNAL;
const BIGNUM*
foil_openssl_rsa_set_q(
RSA* rsa,
- const FoilBytes* bytes);
+ const FoilBytes* bytes)
+ FOIL_INTERNAL;
const BIGNUM*
foil_openssl_rsa_set_dmp1(
RSA* rsa,
- const FoilBytes* bytes);
+ const FoilBytes* bytes)
+ FOIL_INTERNAL;
const BIGNUM*
foil_openssl_rsa_set_dmq1(
RSA* rsa,
- const FoilBytes* bytes);
+ const FoilBytes* bytes)
+ FOIL_INTERNAL;
const BIGNUM*
foil_openssl_rsa_set_iqmp(
RSA* rsa,
- const FoilBytes* bytes);
+ const FoilBytes* bytes)
+ FOIL_INTERNAL;
#define FOIL_RSA_FIELD(rsa,x) foil_openssl_rsa_get_##x(rsa)
#define FOIL_RSA_KEY_SET_BN(rsa,x,data) foil_openssl_rsa_set_##x(rsa, &(data)->x)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/rpm/foil.spec
^
|
@@ -1,5 +1,6 @@
Name: libfoil
-Version: 1.0.23
+
+Version: 1.0.25
Release: 0
Summary: Yet another glib-style crypto API
Group: Development/Libraries
@@ -46,8 +47,8 @@
%setup -q
%build
-make -C libfoil LIBDIR=%{_libdir} KEEP_SYMBOLS=1 release pkgconfig
-make -C tools LIBDIR=%{_libdir} KEEP_SYMBOLS=1 release
+make -C libfoil %{_smp_mflags} LIBDIR=%{_libdir} KEEP_SYMBOLS=1 release pkgconfig
+make -C tools %{_smp_mflags} LIBDIR=%{_libdir} KEEP_SYMBOLS=1 release
%install
rm -rf %{buildroot}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/test/common/Makefile
^
|
@@ -15,6 +15,8 @@
SRC = $(EXE).c
endif
+COMMON_SRC ?= test_main.c
+
#
# Required packages
#
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/test/coverage/run
^
|
@@ -16,6 +16,7 @@
test_digest \
test_hmac \
test_input \
+test_kdf \
test_key_aes \
test_key_des \
test_key_rsa \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/test/libfoil/Makefile
^
|
@@ -14,6 +14,7 @@
@$(MAKE) -C test_digest $*
@$(MAKE) -C test_hmac $*
@$(MAKE) -C test_input $*
+ @$(MAKE) -C test_kdf $*
@$(MAKE) -C test_key_aes $*
@$(MAKE) -C test_key_des $*
@$(MAKE) -C test_key_rsa $*
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/test/libfoil/test_cipher/Makefile
^
|
@@ -1,6 +1,5 @@
# -*- Mode: makefile-gmake -*-
EXE = test_cipher
-COMMON_SRC = test_main.c
include ../../common/Makefile
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/test/libfoil/test_cmac/Makefile
^
|
@@ -1,6 +1,5 @@
# -*- Mode: makefile-gmake -*-
EXE = test_cmac
-COMMON_SRC = test_main.c
include ../../common/Makefile
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/test/libfoil/test_digest/Makefile
^
|
@@ -1,6 +1,5 @@
# -*- Mode: makefile-gmake -*-
EXE = test_digest
-COMMON_SRC = test_main.c
include ../../common/Makefile
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/test/libfoil/test_hmac/Makefile
^
|
@@ -1,6 +1,5 @@
# -*- Mode: makefile-gmake -*-
EXE = test_hmac
-COMMON_SRC = test_main.c
include ../../common/Makefile
|
[-]
[+]
|
Added |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/test/libfoil/test_kdf/Makefile
^
|
@@ -0,0 +1,5 @@
+# -*- Mode: makefile-gmake -*-
+
+EXE = test_kdf
+
+include ../../common/Makefile
|
[-]
[+]
|
Added |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/test/libfoil/test_kdf/test_kdf.c
^
|
@@ -0,0 +1,235 @@
+/*
+ * Copyright (C) 2022 by Slava Monich
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation
+ * are those of the authors and should not be interpreted as representing
+ * any official policies, either expressed or implied.
+ */
+
+#include "test_common.h"
+
+#include "foil_kdf.h"
+#include "foil_digest.h"
+#include "foil_random.h"
+
+typedef struct test_kdf {
+ const char* name;
+ GType (*digest_type)(void);
+ const char* pw;
+ gssize pwlen;
+ FoilBytes salt;
+ guint iter;
+ guint dlen;
+ FoilBytes output;
+} TestKdf;
+
+static
+void
+test_null(
+ void)
+{
+ FoilBytes salt;
+
+ salt.val = (void*)&salt;
+ salt.len = sizeof(salt);
+ g_assert(!foil_kdf_pbkdf2((GType)0, NULL, 0, NULL, 0, 0));
+ /* Not a digest type: */
+ g_assert(!foil_kdf_pbkdf2(FOIL_RANDOM_DEFAULT, NULL, 0, &salt, 1, 0));
+ /* No iterations */
+ g_assert(!foil_kdf_pbkdf2(FOIL_DIGEST_SHA1, NULL, 0, &salt, 0, 0));
+ /* NULL password */
+ g_assert(!foil_kdf_pbkdf2(FOIL_DIGEST_SHA1, NULL, -1, &salt, 1, 0));
+}
+
+static
+void
+test_kdf(
+ gconstpointer param)
+{
+ const TestKdf* test = param;
+ GBytes* result = foil_kdf_pbkdf2(test->digest_type(), test->pw,
+ test->pwlen, &test->salt, test->iter, test->dlen);
+ gsize size = 0;
+ gconstpointer data;
+
+ g_assert(result);
+ data = g_bytes_get_data(result, &size);
+
+ g_assert_cmpuint(size, == ,test->output.len);
+ g_assert(!memcmp(data, test->output.val, size));
+ g_bytes_unref(result);
+}
+
+/* Test descriptors */
+
+#define TEST_(name) "/kdf/" name
+
+/*
+ * RFC 6070
+ * PKCS #5: Password-Based Key Derivation Function 2 (PBKDF2) Test Vectors
+ */
+
+static guint8 rfc6070_001_output[] = {
+ 0x0c, 0x60, 0xc8, 0x0f, 0x96, 0x1f, 0x0e, 0x71,
+ 0xf3, 0xa9, 0xb5, 0x24, 0xaf, 0x60, 0x12, 0x06,
+ 0x2f, 0xe0, 0x37, 0xa6
+};
+
+static guint8 rfc6070_002_output[] = {
+ 0xea, 0x6c, 0x01, 0x4d, 0xc7, 0x2d, 0x6f, 0x8c,
+ 0xcd, 0x1e, 0xd9, 0x2a, 0xce, 0x1d, 0x41, 0xf0,
+ 0xd8, 0xde, 0x89, 0x57
+};
+
+static guint8 rfc6070_003_output[] = {
+ 0x4b, 0x00, 0x79, 0x01, 0xb7, 0x65, 0x48, 0x9a,
+ 0xbe, 0xad, 0x49, 0xd9, 0x26, 0xf7, 0x21, 0xd0,
+ 0x65, 0xa4, 0x29, 0xc1
+};
+
+#ifdef TEST_16777216
+/* This one takes too long to run it on every build (although it succeeds) */
+static guint8 rfc6070_004_output[] = {
+ 0xee, 0xfe, 0x3d, 0x61, 0xcd, 0x4d, 0xa4, 0xe4,
+ 0xe9, 0x94, 0x5b, 0x3d, 0x6b, 0xa2, 0x15, 0x8c,
+ 0x26, 0x34, 0xe9, 0x84
+};
+#endif
+
+static guint8 rfc6070_005_output[] = {
+ 0x3d, 0x2e, 0xec, 0x4f, 0xe4, 0x1c, 0x84, 0x9b,
+ 0x80, 0xc8, 0xd8, 0x36, 0x62, 0xc0, 0xe4, 0x4a,
+ 0x8b, 0x29, 0x1a, 0x96, 0x4c, 0xf2, 0xf0, 0x70,
+ 0x38
+};
+
+static guint8 rfc6070_006_output[] = {
+ 0x56, 0xfa, 0x6a, 0xa7, 0x55, 0x48, 0x09, 0x9d,
+ 0xcc, 0x37, 0xd7, 0xf0, 0x34, 0x25, 0xe0, 0xc3
+};
+
+static guint8 collision_salt[] = {
+ 0xa0, 0x09, 0xc1, 0xa4, 0x85, 0x91, 0x2c, 0x6a,
+ 0xe6, 0x30, 0xd3, 0xe7, 0x44, 0x24, 0x0b, 0x04
+};
+
+static guint8 collision_output[] = {
+ 0x17, 0xeb, 0x40, 0x14, 0xc8, 0xc4, 0x61, 0xc3,
+ 0x00, 0xe9, 0xb6, 0x15, 0x18, 0xb9, 0xa1, 0x8b
+};
+
+static const TestKdf tests[] = {
+ {
+ TEST_("RFC6070/001"),
+ foil_impl_digest_sha1_get_type,
+ "password", 8,
+ { (const guint8*) "salt", 4 },
+ 1,
+ 20,
+ { TEST_ARRAY_AND_SIZE(rfc6070_001_output) }
+ },{
+ TEST_("RFC6070/002"),
+ foil_impl_digest_sha1_get_type,
+ "password", -1, /* Do strlen() on the password */
+ { (const guint8*) "salt", 4 },
+ 2,
+ 0, /* Use the default (digest size) */
+ { TEST_ARRAY_AND_SIZE(rfc6070_002_output) }
+ },{
+ TEST_("RFC6070/003"),
+ foil_impl_digest_sha1_get_type,
+ "password", 8,
+ { (const guint8*) "salt", 4 },
+ 4096,
+ 20,
+ { TEST_ARRAY_AND_SIZE(rfc6070_003_output) }
+#ifdef TEST_16777216
+ },{ /* This one takes too long to run it on every build */
+ TEST_("RFC6070/004"),
+ foil_impl_digest_sha1_get_type,
+ "password", 8,
+ { (const guint8*) "salt", 4 },
+ 16777216,
+ 20,
+ { TEST_ARRAY_AND_SIZE(rfc6070_004_output) }
+#endif
+ },{
+ TEST_("RFC6070/005"),
+ foil_impl_digest_sha1_get_type,
+ "passwordPASSWORDpassword", 24,
+ { (const guint8*) "saltSALTsaltSALTsaltSALTsaltSALTsalt", 36 },
+ 4096,
+ 25,
+ { TEST_ARRAY_AND_SIZE(rfc6070_005_output) }
+ },{
+ TEST_("RFC6070/006"),
+ foil_impl_digest_sha1_get_type,
+ "pass\0word", 9,
+ { (const guint8*) "sa\0lt", 5 },
+ 4096,
+ 16,
+ { TEST_ARRAY_AND_SIZE(rfc6070_006_output) }
+ },{ /* Collision example from Wikipedia */
+ TEST_("collision/1"),
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/test/libfoil/test_key_aes/Makefile
^
|
@@ -1,6 +1,5 @@
# -*- Mode: makefile-gmake -*-
EXE = test_key_aes
-COMMON_SRC = test_main.c
include ../../common/Makefile
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/test/libfoil/test_key_des/Makefile
^
|
@@ -1,6 +1,5 @@
# -*- Mode: makefile-gmake -*-
EXE = test_key_des
-COMMON_SRC = test_main.c
include ../../common/Makefile
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/test/libfoil/test_output/Makefile
^
|
@@ -1,6 +1,5 @@
# -*- Mode: makefile-gmake -*-
EXE = test_output
-COMMON_SRC = test_main.c
include ../../common/Makefile
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/tools/foilmsg/Makefile
^
|
@@ -35,23 +35,12 @@
RELEASE_BUILD_DIR = $(BUILD_DIR)/release
#
-# Application version
-#
-
-VERSION_FILE = ../../VERSION
-VERSION_MAJOR = $(shell head -1 $(VERSION_FILE) | cut -f1 -d.)
-VERSION_MINOR = $(shell head -1 $(VERSION_FILE) | cut -f2 -d.)
-VERSION_RELEASE = $(shell head -1 $(VERSION_FILE) | cut -f3 -d.)
-VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
-
-#
# Tools and flags
#
CC = $(CROSS_COMPILE)gcc
LD = $(CC)
WARNINGS = -Wall
-DEFINES += -DVERSION=$(VERSION)
INCLUDES = -I$(LIBFOIL_DIR)/include -I$(LIBFOILMSG_DIR)/include
BASE_FLAGS = -fPIC
BASE_LDFLAGS = $(BASE_FLAGS) $(LDFLAGS)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/tools/foilmsg/foilmsg.c
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2021 by Slava Monich
+ * Copyright (C) 2016-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -386,7 +386,7 @@
gboolean show_info = FALSE;
gboolean for_self = FALSE;
gboolean binary = FALSE;
-#ifdef VERSION
+#ifdef FOIL_VERSION_STRING
gboolean print_version = FALSE;
#endif
GError* error = NULL;
@@ -418,7 +418,7 @@
"Write output to FILE", "FILE" },
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
"Enable verbose output", NULL },
-#ifdef VERSION
+#ifdef FOIL_VERSION_STRING
{ "version", 0, 0, G_OPTION_ARG_NONE, &print_version,
"Print version and exit", NULL },
#endif
@@ -500,9 +500,9 @@
decrypt = TRUE;
}
-#ifdef VERSION
+#ifdef FOIL_VERSION_STRING
if (ok && print_version) {
- printf("%s %s\n", gutil_log_default.name, G_STRINGIFY(VERSION));
+ printf("%s %s\n", gutil_log_default.name, FOIL_VERSION_STRING);
ret = RET_OK;
} else
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/tools/foilpng/Makefile
^
|
@@ -35,23 +35,12 @@
RELEASE_BUILD_DIR = $(BUILD_DIR)/release
#
-# Application version
-#
-
-VERSION_FILE = ../../VERSION
-VERSION_MAJOR = $(shell head -1 $(VERSION_FILE) | cut -f1 -d.)
-VERSION_MINOR = $(shell head -1 $(VERSION_FILE) | cut -f2 -d.)
-VERSION_RELEASE = $(shell head -1 $(VERSION_FILE) | cut -f3 -d.)
-VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
-
-#
# Tools and flags
#
CC = $(CROSS_COMPILE)gcc
LD = $(CC)
WARNINGS = -Wall
-DEFINES += -DVERSION=$(VERSION)
INCLUDES = -I$(LIBFOIL_DIR)/include -I$(LIBFOILMSG_DIR)/include
BASE_FLAGS = -fPIC
BASE_LDFLAGS = $(BASE_FLAGS) $(LDFLAGS)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/foil/tools/foilpng/foilpng.c
^
|
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017-2021 by Slava Monich
+ * Copyright (C) 2017-2022 by Slava Monich
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -399,7 +399,7 @@
gboolean verbose = FALSE;
gboolean decrypt = FALSE;
gboolean for_self = FALSE;
-#ifdef VERSION
+#ifdef FOIL_VERSION_STRING
gboolean print_version = FALSE;
#endif
GError* error = NULL;
@@ -422,7 +422,7 @@
"Public key of the other party", "FILE" },
{ "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose,
"Enable verbose output", NULL },
-#ifdef VERSION
+#ifdef FOIL_VERSION_STRING
{ "version", 0, 0, G_OPTION_ARG_NONE, &print_version,
"Print version and exit", NULL },
#endif
@@ -488,9 +488,9 @@
ok = FALSE;
}
-#ifdef VERSION
+#ifdef FOIL_VERSION_STRING
if (ok && print_version) {
- printf("%s %s\n", gutil_log_default.name, G_STRINGIFY(VERSION));
+ printf("%s %s\n", gutil_log_default.name, FOIL_VERSION_STRING);
ret = RET_OK;
} else
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/libglibutil/LICENSE
^
|
@@ -1,4 +1,4 @@
-Copyright (C) 2014-2021 Jolla Ltd.
+Copyright (C) 2014-2022 Jolla Ltd.
You may use this file under the terms of BSD license as follows:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/libglibutil/Makefile
^
|
@@ -20,7 +20,7 @@
VERSION_MAJOR = 1
VERSION_MINOR = 0
-VERSION_RELEASE = 56
+VERSION_RELEASE = 64
# Version for pkg-config
PCVERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
@@ -152,7 +152,7 @@
@echo $(COVERAGE_STATIC_LIB)
clean:
- $(MAKE) -C test clean
+ make -C test clean
rm -fr test/coverage/results test/coverage/*.gcov
rm -f *~ $(SRC_DIR)/*~ $(INCLUDE_DIR)/*~
rm -fr $(BUILD_DIR) RPMS installroot
@@ -162,7 +162,7 @@
rm -fr debian/*.install
test:
- $(MAKE) -C test test
+ make -C test test
$(BUILD_DIR):
mkdir -p $@
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/libglibutil/debian/changelog
^
|
@@ -1,3 +1,48 @@
+libglibutil (1.0.64) unstable; urgency=low
+
+ * Resolved a mysterious parallel build issue
+
+ -- Slava Monich <slava.monich@jolla.com> Tue, 17 May 2022 03:56:50 +0300
+
+libglibutil (1.0.63) unstable; urgency=low
+
+ * Added gutil_bytes_has_prefix()
+ * Added gutil_bytes_has_suffix()
+
+ -- Slava Monich <slava.monich@jolla.com> Sat, 23 Apr 2022 21:24:25 +0300
+
+libglibutil (1.0.62) unstable; urgency=low
+
+ * Added gutil_strlen0()
+ * Added gutil_strv_find_last()
+ * Added gutil_strv_remove_dups()
+
+ -- Slava Monich <slava.monich@jolla.com> Sun, 13 Mar 2022 21:59:26 +0200
+
+libglibutil (1.0.61) unstable; urgency=low
+
+ * Added gutil_strv_remove()
+
+ -- Slava Monich <slava.monich@jolla.com> Thu, 25 Nov 2021 18:31:18 +0200
+
+libglibutil (1.0.60) unstable; urgency=low
+
+ * Housekeeping release
+
+ -- Slava Monich <slava.monich@jolla.com> Mon, 22 Nov 2021 23:37:14 +0200
+
+libglibutil (1.0.58) unstable; urgency=low
+
+ * Don't check upper bound when setting log level from the envvironment
+
+ -- Slava Monich <slava.monich@jolla.com> Wed, 17 Nov 2021 13:17:45 +0200
+
+libglibutil (1.0.57) unstable; urgency=low
+
+ * Fixed unit tests for older 32-bit systems
+
+ -- Slava Monich <slava.monich@jolla.com> Mon, 08 Nov 2021 02:28:37 +0200
+
libglibutil (1.0.56) unstable; urgency=low
* Added gutil_parse_int64()
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/libglibutil/debian/copyright
^
|
@@ -1,4 +1,4 @@
-Copyright (C) 2014-2021 Jolla Ltd.
+Copyright (C) 2014-2022 Jolla Ltd.
You may use this file under the terms of BSD license as follows:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/libglibutil/include/gutil_misc.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2021 Jolla Ltd.
- * Copyright (C) 2016-2021 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2022 Jolla Ltd.
+ * Copyright (C) 2016-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -135,6 +135,18 @@
GBytes* bytes,
const GUtilData* data); /* Since 1.0.41 */
+gboolean
+gutil_bytes_has_prefix(
+ GBytes* bytes,
+ const void* data,
+ gsize size); /* Since 1.0.63 */
+
+gboolean
+gutil_bytes_has_suffix(
+ GBytes* bytes,
+ const void* data,
+ gsize size); /* Since 1.0.63 */
+
gsize
gutil_ptrv_length(
const void* ptrv); /* Since 1.0.50 */
@@ -149,6 +161,10 @@
gsize size); /* Since 1.0.52 */
gsize
+gutil_strlen0(
+ const char* str); /* Since 1.0.62 */
+
+gsize
gutil_range_init_with_bytes(
GUtilRange* range,
GBytes* bytes); /* Since 1.0.55 */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/libglibutil/include/gutil_strv.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2014-2020 Jolla Ltd.
- * Copyright (C) 2014-2020 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2014-2022 Jolla Ltd.
+ * Copyright (C) 2014-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -69,6 +69,15 @@
const char* s);
/**
+ * Returns index of the last occurrence of specified string in the string
+ * array, or -1 if the string is not found.
+ */
+int
+gutil_strv_find_last(
+ const GStrV* sv,
+ const char* s); /* Since 1.0.62 */
+
+/**
* Checks if string array contains the specified string.
*/
gboolean
@@ -107,6 +116,19 @@
G_GNUC_WARN_UNUSED_RESULT;
/**
+ * Removes one or all matching strings from the array and frees them.
+ */
+GStrV*
+gutil_strv_remove(
+ GStrV* sv,
+ const char* s,
+ gboolean remove_all) /* Since 1.0.61 */
+ G_GNUC_WARN_UNUSED_RESULT;
+
+#define gutil_strv_remove_one(sv, s) gutil_strv_remove(sv, s, FALSE)
+#define gutil_strv_remove_all(sv, s) gutil_strv_remove(sv, s, TRUE)
+
+/**
* Checks two string arrays for equality.
*/
gboolean
@@ -115,6 +137,13 @@
const GStrV* sv2);
/**
+ * Removes all duplicates from the string array.
+ */
+GStrV*
+gutil_strv_remove_dups(
+ GStrV* sv); /* Since 1.0.62 */
+
+/**
* Sorts the string array
*/
GStrV*
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/libglibutil/rpm/libglibutil.spec
^
|
@@ -1,6 +1,6 @@
Name: libglibutil
-Version: 1.0.56
+Version: 1.0.64
Release: 0
Summary: Library of glib utilities
License: BSD
@@ -9,6 +9,11 @@
BuildRequires: pkgconfig
BuildRequires: pkgconfig(glib-2.0)
+
+# license macro requires rpm >= 4.11
+BuildRequires: pkgconfig(rpm)
+%define license_support %(pkg-config --exists 'rpm >= 4.11'; echo $?)
+
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
@@ -33,7 +38,7 @@
make LIBDIR=%{_libdir} DESTDIR=%{buildroot} install-dev
%check
-make %{_smp_mflags} -C test test
+make -C test test
%post -p /sbin/ldconfig
@@ -42,6 +47,9 @@
%files
%defattr(-,root,root,-)
%{_libdir}/%{name}.so.*
+%if %{license_support} == 0
+%license LICENSE
+%endif
%files devel
%defattr(-,root,root,-)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/libglibutil/src/gutil_log.c
^
|
@@ -14,8 +14,8 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the names of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -676,7 +676,7 @@
int val = 0;
if (gutil_parse_int(getenv("GUTIL_LOG_DEFAULT_LEVEL"), 0, &val) &&
- val >= GLOG_LEVEL_INHERIT && val <= GLOG_LEVEL_VERBOSE) {
+ val >= GLOG_LEVEL_INHERIT) {
gutil_log_default.level = val;
GDEBUG("Default log level %d", val);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/libglibutil/src/gutil_misc.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2021 Jolla Ltd.
- * Copyright (C) 2016-2021 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2022 Jolla Ltd.
+ * Copyright (C) 2016-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -511,6 +511,52 @@
}
}
+gboolean
+gutil_bytes_has_prefix(
+ GBytes* bytes,
+ const void* data,
+ gsize size) /* Since 1.0.63 */
+{
+ if (!bytes) {
+ /* NULL GBytes has neither prefix nor suffix, even an empty one */
+ return FALSE;
+ } else if (!size) {
+ /*
+ * That's largely a philosophical question - can anything have
+ * an empty prefix? Let's assume that the answer is yes. And
+ * then if anything can have such a prefix, everything has it.
+ * Right? Except for NULL GBytes which doesn't have anything
+ * as said earlier.
+ */
+ return TRUE;
+ } else {
+ gsize bytes_size;
+ const guint8* contents = g_bytes_get_data(bytes, &bytes_size);
+
+ return (bytes_size >= size) && !memcmp(contents, data, size);
+ }
+}
+
+gboolean
+gutil_bytes_has_suffix(
+ GBytes* bytes,
+ const void* data,
+ gsize size) /* Since 1.0.63 */
+{
+ /* Treat an empty suffix the same way as an empty prefix */
+ if (!bytes) {
+ return FALSE;
+ } else if (!size) {
+ return TRUE;
+ } else {
+ gsize bytes_size;
+ const guint8* contents = g_bytes_get_data(bytes, &bytes_size);
+
+ return (bytes_size >= size) &&
+ !memcmp(contents + (bytes_size - size), data, size);
+ }
+}
+
/* Calculates the length of NULL-terminated array of pointers */
gsize
gutil_ptrv_length(
@@ -556,6 +602,14 @@
}
}
+/* NULL-tolerant version of strlen */
+gsize
+gutil_strlen0(
+ const char* str) /* Since 1.0.62 */
+{
+ return str ? strlen(str) : 0;
+}
+
gsize
gutil_range_init_with_bytes(
GUtilRange* range,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/libglibutil/src/gutil_strv.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2014-2021 Jolla Ltd.
- * Copyright (C) 2014-2021 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2014-2022 Jolla Ltd.
+ * Copyright (C) 2014-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -88,9 +88,10 @@
const GStrV* sv,
const char* s)
{
- if (sv && s) {
+ if (G_LIKELY(sv) && G_LIKELY(s)) {
int i = 0;
const GStrV* ptr;
+
for (ptr = sv; *ptr; ptr++, i++) {
if (!strcmp(*ptr, s)) {
return i;
@@ -100,6 +101,36 @@
return -1;
}
+/* Helper for gutil_strv_find_last and friends */
+static
+int
+gutil_strv_find_last_impl(
+ const GStrV* sv,
+ const char* s,
+ int i /* exclisive */)
+{
+ while (i > 0) {
+ if (!strcmp(sv[--i], s)) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+/**
+ * Returns index of the last occurrence of specified string in the string
+ * array, or -1 if the string is not found.
+ */
+int
+gutil_strv_find_last(
+ const GStrV* sv,
+ const char* s) /* Since 1.0.62 */
+{
+ /* NULL sv is handled by gutil_strv_length() */
+ return G_LIKELY(s) ? gutil_strv_find_last_impl(sv, s,
+ gutil_strv_length(sv)) : -1;
+}
+
/**
* Checks if string array contains the specified string.
*/
@@ -158,6 +189,22 @@
return sv;
}
+/* Internal helper for removal functions */
+static
+GStrV*
+gutil_strv_remove_impl(
+ GStrV* sv,
+ guint pos,
+ guint len,
+ gboolean free_string)
+{
+ if (free_string) {
+ g_free(sv[pos]);
+ }
+ memmove(sv + pos, sv + pos + 1, sizeof(char*)*(len - pos));
+ return g_realloc(sv, sizeof(char*)*len);
+}
+
/**
* Removes the string from the specified position in the array.
*/
@@ -169,12 +216,66 @@
{
if (G_LIKELY(sv) && G_LIKELY(pos >= 0)) {
const int len = gutil_strv_length(sv);
+
if (pos < len) {
- if (free_string) {
- g_free(sv[pos]);
+ sv = gutil_strv_remove_impl(sv, pos, len, free_string);
+ }
+ }
+ return sv;
+}
+
+/**
+ * Removes one or all matching strings from the array and frees them.
+ */
+GStrV*
+gutil_strv_remove(
+ GStrV* sv,
+ const char* s,
+ gboolean remove_all)
+{
+ if (G_LIKELY(sv) && G_LIKELY(s)) {
+ const int pos = gutil_strv_find(sv, s);
+
+ if (pos >= 0) {
+ guint len = gutil_strv_length(sv);
+
+ sv = gutil_strv_remove_impl(sv, pos, len, TRUE);
+ if (remove_all) {
+ int i, l;
+
+ len--;
+ l = len - pos;
+ while ((i = gutil_strv_find_last_impl(sv + pos, s, l)) >= 0) {
+ sv = gutil_strv_remove_impl(sv, pos + i, len--, TRUE);
+ l = i;
+ }
+ }
+ }
+ }
+ return sv;
+}
+
+/**
+ * Removes all duplicates from the string array.
+ */
+GStrV*
+gutil_strv_remove_dups(
+ GStrV* sv) /* Since 1.0.62 */
+{
+ if (G_LIKELY(sv)) {
+ guint len = gutil_strv_length(sv), pos = 0, l = len;
+
+ while (pos < len) {
+ int i = gutil_strv_find_last_impl(sv + pos + 1, sv[pos], l - 1);
+
+ if (i < 0) {
+ /* Done with this string, switch to the next one */
+ pos++;
+ l = len - pos;
+ } else {
+ sv = gutil_strv_remove_impl(sv, pos + 1 + i, len--, TRUE);
+ l = i + 1;
}
- memmove(sv + pos, sv + pos + 1, sizeof(char*)*(len - pos));
- sv = g_realloc(sv, sizeof(char*)*len);
}
}
return sv;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/libglibutil/test/common/test_common.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2018 Jolla Ltd.
- * Copyright (C) 2016-2018 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2022 Jolla Ltd.
+ * Copyright (C) 2016-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -14,8 +14,8 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the names of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -58,6 +58,7 @@
/* Macros */
#define TEST_INIT_DATA(a,b) ((a).bytes = (void*)(b), (a).size = sizeof(b))
+#define TEST_ARRAY_AND_SIZE(a) (a), sizeof(a)
#endif /* TEST_COMMON_H */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/libglibutil/test/test_misc/test_misc.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2021 Jolla Ltd.
- * Copyright (C) 2016-2021 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2022 Jolla Ltd.
+ * Copyright (C) 2016-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -224,7 +224,7 @@
g_assert(!gutil_parse_uint("-1", 0, &value));
g_assert(!gutil_parse_uint(" -1 ", 0, &value));
g_assert(gutil_parse_uint("4294967295", 0, &value));
- g_assert_cmpuint(value, == ,4294967295);
+ g_assert_cmpuint(value, == ,4294967295U);
g_assert(gutil_parse_uint(" 0x7fffffff ", 0, &value));
g_assert_cmpuint(value, == ,0x7fffffff);
g_assert(gutil_parse_uint(" 7fffffff ", 16, &value));
@@ -260,9 +260,9 @@
g_assert(gutil_parse_int64("42", 0, &value));
g_assert_cmpint(value, == ,42);
g_assert(gutil_parse_int64("-2147483649", 0, &value));
- g_assert_cmpint(value, == ,-2147483649);
+ g_assert_cmpint(value, == ,G_GINT64_CONSTANT(-2147483649));
g_assert(gutil_parse_int64("4294967295", 0, &value));
- g_assert_cmpint(value, == ,4294967295);
+ g_assert_cmpint(value, == ,G_GINT64_CONSTANT(4294967295));
g_assert(gutil_parse_int64(" 0x7fffffff ", 0, &value));
g_assert_cmpint(value, == ,0x7fffffff);
g_assert(gutil_parse_int64(" 7fffffff ", 16, &value));
@@ -271,13 +271,15 @@
g_assert_cmpint(value, == ,0x7ffffffe);
g_assert(gutil_parse_int64("0xffffffff", 0, &value));
g_assert_cmpint(value, == ,0xffffffff);
- g_assert(!gutil_parse_int64("0x10000000000000000", 0, &value));
- g_assert(!gutil_parse_int64("-9223372036854775809", 0, &value));
g_assert(gutil_parse_int64("-9223372036854775808", 0, &value));
g_assert_cmpint(value, == ,0x8000000000000000);
- g_assert(!gutil_parse_int64("9223372036854775808", 0, &value));
g_assert(gutil_parse_int64("9223372036854775807", 0, &value));
g_assert_cmpint(value, == ,0x7fffffffffffffff);
+#ifndef _WIN32
+ g_assert(!gutil_parse_int64("0x10000000000000000", 0, &value));
+ g_assert(!gutil_parse_int64("-9223372036854775809", 0, &value));
+ g_assert(!gutil_parse_int64("9223372036854775808", 0, &value));
+#endif
}
/*==========================================================================*
@@ -302,12 +304,11 @@
g_assert_cmpuint(value, == ,0);
g_assert(gutil_parse_uint64("42", 0, &value));
g_assert_cmpuint(value, == ,42);
- g_assert(!gutil_parse_uint64("0x10000000000000000", 0, &value));
g_assert(!gutil_parse_uint64("-2147483649", 0, &value));
g_assert(!gutil_parse_uint64("-1", 0, &value));
g_assert(!gutil_parse_uint64(" -1 ", 0, &value));
g_assert(gutil_parse_uint64("4294967295", 0, &value));
- g_assert_cmpuint(value, == ,4294967295);
+ g_assert_cmpuint(value, == ,4294967295U);
g_assert(!gutil_parse_uint64(" 0x7fffffff ffffffff ", 0, &value));
g_assert(gutil_parse_uint64(" 0x7fffffffffffffff ", 0, &value));
g_assert_cmpuint(value, == ,0x7fffffffffffffff);
@@ -318,6 +319,9 @@
g_assert_cmpuint(value, == ,0x100000000);
g_assert(gutil_parse_uint64("0xffffffffffffffff", 0, &value));
g_assert_cmpuint(value, == ,0xffffffffffffffff);
+#ifndef _WIN32
+ g_assert(!gutil_parse_uint64("0x10000000000000000", 0, &value));
+#endif
}
/*==========================================================================*
@@ -675,6 +679,20 @@
}
/*==========================================================================*
+ * strlen
+ *==========================================================================*/
+
+static
+void
+test_strlen(
+ void)
+{
+ g_assert(!gutil_strlen0(NULL));
+ g_assert_cmpuint(gutil_strlen0(""), == ,0);
+ g_assert_cmpuint(gutil_strlen0("1"), == ,1);
+}
+
+/*==========================================================================*
* range_init
*==========================================================================*/
@@ -751,6 +769,64 @@
}
/*==========================================================================*
+ * bytes_prefix
+ *==========================================================================*/
+
+static
+void
+test_bytes_prefix(
+ void)
+{
+ static const guint8 data[] = { 0x01, 0x02, 0x03, 0x04 };
+ static const guint8 prefix[] = { 0x01, 0x02 };
+ static const guint8 not_prefix[] = { 0x03, 0x04 };
+ static const guint8 too_long[] = { 0x01, 0x02, 0x03, 0x04, 0x05 };
+ GBytes* empty = g_bytes_new_static(NULL, 0);
+ GBytes* bytes = g_bytes_new_static(TEST_ARRAY_AND_SIZE(data));
+
+ /* NULL GBytes doesn't have any prefix, even an empty one */
+ g_assert(!gutil_bytes_has_prefix(NULL, NULL, 0));
+
+ /* Anything has an empty prefix */
+ g_assert(gutil_bytes_has_prefix(empty, NULL, 0));
+ g_assert(gutil_bytes_has_prefix(bytes, prefix, 0));
+
+ /* Test the matching */
+ g_assert(gutil_bytes_has_prefix(bytes, TEST_ARRAY_AND_SIZE(prefix)));
+ g_assert(!gutil_bytes_has_prefix(bytes, TEST_ARRAY_AND_SIZE(not_prefix)));
+ g_assert(!gutil_bytes_has_prefix(bytes, TEST_ARRAY_AND_SIZE(too_long)));
+}
+
+/*==========================================================================*
+ * bytes_suffix
+ *==========================================================================*/
+
+static
+void
+test_bytes_suffix(
+ void)
+{
+ static const guint8 data[] = { 0x01, 0x02, 0x03, 0x04 };
+ static const guint8 suffix[] = { 0x03, 0x04 };
+ static const guint8 not_suffix[] = { 0x02, 0x03 };
+ static const guint8 too_long[] = { 0x01, 0x02, 0x03, 0x04, 0x05 };
+ GBytes* empty = g_bytes_new_static(NULL, 0);
+ GBytes* bytes = g_bytes_new_static(TEST_ARRAY_AND_SIZE(data));
+
+ /* NULL GBytes doesn't have any suffix, even an empty one */
+ g_assert(!gutil_bytes_has_suffix(NULL, NULL, 0));
+
+ /* Anything has an empty suffix */
+ g_assert(gutil_bytes_has_suffix(empty, NULL, 0));
+ g_assert(gutil_bytes_has_suffix(bytes, suffix, 0));
+
+ /* Test the matching */
+ g_assert(gutil_bytes_has_suffix(bytes, TEST_ARRAY_AND_SIZE(suffix)));
+ g_assert(!gutil_bytes_has_suffix(bytes, TEST_ARRAY_AND_SIZE(not_suffix)));
+ g_assert(!gutil_bytes_has_suffix(bytes, TEST_ARRAY_AND_SIZE(too_long)));
+}
+
+/*==========================================================================*
* Common
*==========================================================================*/
@@ -785,8 +861,11 @@
g_test_add_func(TEST_("ptrv_lenght"), test_ptrv_length);
g_test_add_func(TEST_("ptrv_free"), test_ptrv_free);
g_test_add_func(TEST_("memdup"), test_memdup);
+ g_test_add_func(TEST_("strlen"), test_strlen);
g_test_add_func(TEST_("range_init"), test_range_init);
g_test_add_func(TEST_("range_prefix"), test_range_prefix);
+ g_test_add_func(TEST_("bytes_prefix"), test_bytes_prefix);
+ g_test_add_func(TEST_("bytes_suffix"), test_bytes_suffix);
test_init(&test_opt, argc, argv);
return g_test_run();
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/libglibutil/test/test_strv/test_strv.c
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2015-2020 Jolla Ltd.
- * Copyright (C) 2015-2020 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2015-2022 Jolla Ltd.
+ * Copyright (C) 2015-2022 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -163,7 +163,12 @@
g_assert(gutil_strv_contains(sv, "b"));
g_assert(gutil_strv_contains(sv, "c"));
g_assert(!gutil_strv_contains(sv, "d"));
- g_assert(gutil_strv_find(sv, "b") == 1);
+ g_assert_cmpint(gutil_strv_find(sv, "b"), == ,1);
+ g_assert_cmpint(gutil_strv_find_last(sv, "a"), == ,0);
+ g_assert_cmpint(gutil_strv_find_last(sv, "b"), == ,2);
+ g_assert_cmpint(gutil_strv_find_last(sv, "c"), == ,3);
+ g_assert_cmpint(gutil_strv_find_last(sv, "d"), == ,-1);
+ g_assert_cmpint(gutil_strv_find_last(NULL, NULL), == ,-1);
g_assert(!gutil_strv_contains(sv, NULL));
g_assert(!gutil_strv_contains(NULL, "a"));
g_assert(!gutil_strv_contains(NULL, NULL));
@@ -179,6 +184,37 @@
test_remove(
void)
{
+ guint orig_len = 8;
+ char** sv = g_strsplit("a,b,c,b,c,c,d,b", ",", 0); /* 8 elements */
+ char** sv1 = g_strsplit("a,b,b,c,c,d,b", ",", 0); /* Minus one c */
+ char** sv2 = g_strsplit("a,c,c,d", ",", 0); /* Minus all b's */
+ char** sv3 = g_strsplit("a,c,c", ",", 0); /* Minus all (actually one) d */
+
+ g_assert(!gutil_strv_remove_all(NULL, NULL));
+ g_assert(gutil_strv_remove_all(sv, NULL) == sv);
+ g_assert_cmpuint(gutil_strv_length(sv), == ,orig_len);
+
+ g_assert(sv == gutil_strv_remove_all(sv, "e")); /* "e" is not there */
+ g_assert_cmpuint(gutil_strv_length(sv), == ,orig_len);
+ g_assert(gutil_strv_equal(sv = gutil_strv_remove_one(sv, "c"), sv1));
+ g_assert(gutil_strv_equal(sv = gutil_strv_remove_all(sv, "b"), sv2));
+ g_assert(gutil_strv_equal(sv = gutil_strv_remove_all(sv, "d"), sv3));
+
+ g_strfreev(sv);
+ g_strfreev(sv1);
+ g_strfreev(sv2);
+ g_strfreev(sv3);
+}
+
+/*==========================================================================*
+ * RemoveAt
+ *==========================================================================*/
+
+static
+void
+test_remove_at(
+ void)
+{
char** sv = g_strsplit("a,b,c", ",", 0);
char* c = sv[2];
@@ -198,6 +234,27 @@
}
/*==========================================================================*
+ * RemoveDups
+ *==========================================================================*/
+
+static
+void
+test_remove_dups(
+ void)
+{
+ char** sv = g_strsplit("a,b,c,b,c,c,d,b", ",", 0); /* 8 elements */
+ char** sv1 = g_strsplit("a,b,c,d", ",", 0); /* No dups */
+
+ g_assert(!gutil_strv_remove_dups(NULL));
+ g_assert(gutil_strv_equal(sv = gutil_strv_remove_dups(sv), sv1));
+ g_assert(sv == gutil_strv_remove_dups(sv)); /* Nothing to realloc */
+ g_assert(gutil_strv_equal(sv, sv1)); /* Still equal */
+
+ g_strfreev(sv);
+ g_strfreev(sv1);
+}
+
+/*==========================================================================*
* Sort
*==========================================================================*/
@@ -280,6 +337,8 @@
g_test_add_func(TEST_PREFIX "equal", test_equal);
g_test_add_func(TEST_PREFIX "find", test_find);
g_test_add_func(TEST_PREFIX "remove", test_remove);
+ g_test_add_func(TEST_PREFIX "remove_at", test_remove_at);
+ g_test_add_func(TEST_PREFIX "remove_dups", test_remove_dups);
g_test_add_func(TEST_PREFIX "sort", test_sort);
g_test_add_func(TEST_PREFIX "bsearch", test_bsearch);
g_test_add_func(TEST_PREFIX "strip", test_strip);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/qml/CoverPage.qml
^
|
@@ -11,6 +11,7 @@
readonly property int coverActionHeight: Theme.itemSizeSmall
readonly property bool darkOnLight: ('colorScheme' in Theme) && Theme.colorScheme === 1
readonly property string lockIconSource: Qt.resolvedUrl("images/" + (darkOnLight ? "cover-lock-dark.svg" : "cover-lock.svg"))
+ readonly property string displayOn: HarbourSystemState.displayStatus !== HarbourSystemState.MCE_DISPLAY_OFF
Rectangle {
width: parent.width
@@ -21,61 +22,17 @@
}
Rectangle {
- id: countdown
-
height: appTitle.height
- width: active ? Math.round(value) : cover.width
+ width: Math.round(parent.width * (active ? value : 1))
color: Theme.primaryColor
opacity: 0.1
- readonly property bool active: list.model.needTimer && foilModel.timerActive
- property real value
-
- onActiveChanged: {
- countdownRepeatAnimation.stop()
- countdownInitialAnimation.stop()
- value = cover.width
- if (active) {
- var ms = foilModel.millisecondsLeft()
- if (ms > 1000) {
- countdownInitialAnimation.duration = ms - 1000
- countdownInitialAnimation.start()
- }
- }
- }
-
- Connections {
- target: countdown.active ? foilModel : null
- onTimerRestarted: {
- countdownInitialAnimation.stop()
- countdownRepeatAnimation.restart()
- }
- }
+ readonly property bool active: list.model.needTimer && foilModel.timerActive && displayOn
+ readonly property real value: (foilModel.timeLeft - 1)/(foilModel.period - 1)
- NumberAnimation on value {
- id: countdownInitialAnimation
-
- to: 0
- easing.type: Easing.Linear
- }
-
- SequentialAnimation {
- id: countdownRepeatAnimation
-
- NumberAnimation {
- target: countdown
- property: "value"
- to: cover.width
- easing.type: Easing.Linear
- duration: 1000
- }
- NumberAnimation {
- target: countdown
- property: "value"
- to: 0
- easing.type: Easing.Linear
- duration: (foilModel.period - 2) * 1000
- }
+ Behavior on width {
+ enabled: displayOn
+ NumberAnimation { duration: 500 }
}
}
@@ -192,7 +149,7 @@
Timer {
id: currentIndexTimer
- running: list.count > 1
+ running: list.count > 1 && displayOn
interval: 5000
repeat: true
onTriggered: list.incrementCurrentIndex()
@@ -252,6 +209,7 @@
bold: true
}
transform: HarbourTextFlip {
+ enabled: displayOn
text: model.currentPassword
target: passwordLabel
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/qml/EditAuthTokenDialog.qml
^
|
@@ -5,7 +5,6 @@
Dialog {
id: thisDialog
- allowedOrientations: appAllowedOrientations
forwardNavigation: !qrCodeOnly
backNavigation: !qrCodeOnly
canAccept: generator.text !== ""
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/qml/ImportTokensDialog.qml
^
|
@@ -2,8 +2,6 @@
import Sailfish.Silica 1.0
Dialog {
- allowedOrientations: appAllowedOrientations
-
property bool firstTime: true
property int count
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/qml/ScanPage.qml
^
|
@@ -20,6 +20,7 @@
if (token.valid) {
var existingPage = pageStack.previousPage(parentPage)
var newPage = pageStack.replaceAbove(existingPage, Qt.resolvedUrl("EditAuthTokenDialog.qml"), {
+ allowedOrientations: thisPage.allowedOrientations,
//: Dialog button
//% "Save"
acceptText: qsTrId("foilauth-edit_token-save"),
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/qml/TokenListItem.qml
^
|
@@ -64,6 +64,7 @@
color: Theme.highlightColor
visible: landscape && !hotp
transform: HarbourTextFlip {
+ enabled: Qt.application.active
text: thisItem.prevPassword
target: prevPasswordLabel
}
@@ -84,6 +85,7 @@
bold: true
}
transform: HarbourTextFlip {
+ enabled: Qt.application.active
text: thisItem.currentPassword
target: currentPasswordLabel
}
@@ -101,6 +103,7 @@
color: Theme.highlightColor
visible: landscape && !hotp
transform: HarbourTextFlip {
+ enabled: Qt.application.active
text: thisItem.nextPassword
target: nextPasswordLabel
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/qml/TokenListView.qml
^
|
@@ -50,6 +50,7 @@
var n = SailOTP.fetchNewTokens(FoilAuthModel)
if (n > 0) {
var dialog = pageStack.push(Qt.resolvedUrl("ImportTokensDialog.qml"), {
+ allowedOrientations: mainPage.allowedOrientations,
firstTime: !FoilAuthSettings.sailotpImportDone,
count: n
})
@@ -147,6 +148,7 @@
text: qsTrId("foilauth-menu-new_auth_token")
onClicked: {
var editPage = pageStack.push(Qt.resolvedUrl("EditAuthTokenDialog.qml"), {
+ allowedOrientations: mainPage.allowedOrientations,
//: Dialog button
//% "Save"
acceptText: qsTrId("foilauth-edit_token-save"),
@@ -184,62 +186,16 @@
anchors.verticalCenter: header.extraContent.verticalCenter
leftMargin: Theme.horizontalPageMargin + Theme.paddingMedium
rightMargin: header.rightMargin
- minimumValue: 0
+ minimumValue: 1
maximumValue: foilModel.period
+ value: foilModel.timeLeft
visible: opacity > 0
- opacity: active ? 1 : 0
-
- readonly property bool active: foilModel.timerActive
+ opacity: foilModel.timerActive ? 1 : 0
Behavior on opacity { FadeAnimation { } }
-
- onActiveChanged: {
- countdownRepeatAnimation.stop()
- countdownInitialAnimation.stop()
- if (active) {
- var ms = foilModel.millisecondsLeft()
- if (ms > 1000) {
- value = ms / 1000
- countdownInitialAnimation.duration = ms - 1000
- countdownInitialAnimation.start()
- return
- }
- }
- value = 0
- }
-
- Connections {
- target: countdown.active ? foilModel : null
- onTimerRestarted: {
- countdownInitialAnimation.stop()
- countdownRepeatAnimation.restart()
- }
- }
-
- NumberAnimation on value {
- id: countdownInitialAnimation
-
- to: 0
- easing.type: Easing.Linear
- }
-
- SequentialAnimation {
- id: countdownRepeatAnimation
-
- NumberAnimation {
- target: countdown
- property: "value"
- to: foilModel.period
- easing.type: Easing.Linear
- duration: 1000
- }
- NumberAnimation {
- target: countdown
- property: "value"
- to: 0
- easing.type: Easing.Linear
- duration: (foilModel.period - 2) * 1000
- }
+ Behavior on value {
+ enabled: foilModel.timerActive && Qt.application.active
+ NumberAnimation { duration: 500 }
}
}
}
@@ -280,6 +236,7 @@
onClicked: {
var item = tokenListDelegate
pageStack.push(Qt.resolvedUrl("EditAuthTokenDialog.qml"), {
+ allowedOrientations: mainPage.allowedOrientations,
//: Dialog button
//% "Save"
acceptText: qsTrId("foilauth-edit_token-save"),
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/qml/main.qml
^
|
@@ -5,15 +5,10 @@
ApplicationWindow {
id: appWindow
- allowedOrientations: appAllowedOrientations
- initialPage: jailed ? jailPageComponent : mainPageComponent
+ allowedOrientations: Orientation.All
+ initialPage: HarbourProcessState.jailedApp ? jailPageComponent : mainPageComponent
cover: Component { CoverPage { } }
- readonly property bool jailed: HarbourProcessState.jailedApp
- readonly property int appAllowedOrientations: Orientation.All
- readonly property bool appLandscapeMode: orientation === Qt.LandscapeOrientation ||
- orientation === Qt.InvertedLandscapeOrientation
-
Component {
id: mainPageComponent
@@ -51,7 +46,7 @@
}
onLockedChanged: {
lockTimer.stop()
- if (target.locked) {
+ if (FoilAuthSettings.autoLock && target.locked) {
if (wasDimmed) {
// Give the user some time to wake up the screen and
// avoid re-entering the password.
@@ -62,4 +57,17 @@
}
}
}
+
+ Connections {
+ target: FoilAuthSettings
+
+ onAutoLockChanged: {
+ lockTimer.stop()
+ // It's so unlikely that settings change when the device is locked
+ // But it's possible!
+ if (target.autoLock && HarbourSystemState.locked) {
+ FoilAuthModel.lock(false);
+ }
+ }
+ }
}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/settings/harbour-foilauth.json
^
|
@@ -0,0 +1,14 @@
+{
+ "translation_catalog" : "harbour-foilauth",
+ "entries": [
+ {
+ "path": "applications/harbour-foilauth.desktop",
+ "title": "Foil Auth",
+ "type": "page",
+ "icon": "harbour-foilauth",
+ "params": {
+ "source": "/usr/share/harbour-foilauth/qml/settings/settings.qml"
+ }
+ }
+ ]
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/settings/settings.qml
^
|
@@ -0,0 +1,65 @@
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+import org.nemomobile.configuration 1.0
+
+Page {
+ readonly property string rootPath: "/apps/harbour-foilauth/"
+ property alias title: pageHeader.title
+
+ // jolla-settings expects these properties:
+ property var applicationName
+ property var applicationIcon
+
+ SilicaFlickable {
+ anchors.fill: parent
+ contentHeight: content.height
+
+ Column {
+ id: content
+ width: parent.width
+
+ PageHeader {
+ id: pageHeader
+
+ rightMargin: Theme.horizontalPageMargin + (appIcon.visible ? (height - appIcon.padding) : 0)
+ title: applicationName ? applicationName : "Foil Auth"
+ description: applicationName ?
+ //: Settings page header description (app version)
+ //% "Version %1"
+ qsTrId("foilauth-settings_page-header-version").arg("1.1.1") : ""
+
+ Image {
+ id: appIcon
+ readonly property int padding: Theme.paddingLarge
+ readonly property int size: pageHeader.height - 2 * padding
+ x: pageHeader.width - width - Theme.horizontalPageMargin
+ y: padding
+ width: size
+ height: size
+ sourceSize: Qt.size(size,size)
+ source: applicationIcon ? applicationIcon : ""
+ visible: appIcon.status === Image.Ready
+ }
+ }
+
+ TextSwitch {
+ //: Text switch label
+ //% "Automatic locking"
+ text: qsTrId("foilauth-settings_page-autolock-text")
+ //: Text switch description
+ //% "Require to enter Foil password after unlocking the screen."
+ description: qsTrId("foilauth-settings_page-autolock-description")
+ automaticCheck: false
+ checked: autoLockConfig.value
+ onClicked: autoLockConfig.value = !autoLockConfig.value
+
+ ConfigurationValue {
+ id: autoLockConfig
+
+ key: rootPath + "autoLock"
+ defaultValue: true
+ }
+ }
+ }
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/src/FoilAuthDefs.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2019 Jolla Ltd.
- * Copyright (C) 2019 Slava Monich <slava@monich.com>
+ * Copyright (C) 2019-2022 Jolla Ltd.
+ * Copyright (C) 2019-2022 Slava Monich <slava@monich.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -36,12 +36,7 @@
#include <qnamespace.h>
-#ifdef OPENREPOS
-# define FOILAUTH_APP_NAME "openrepos-foilauth"
-#else
-# define FOILAUTH_APP_NAME "harbour-foilauth"
-#endif
-
+#define FOILAUTH_APP_NAME "harbour-foilauth"
#define FOILAUTH_QML_IMPORT "harbour.foilauth"
#define FOILAUTH_DCONF_ROOT "/apps/" FOILAUTH_APP_NAME "/"
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/src/FoilAuthModel.cpp
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2019-2021 Jolla Ltd.
- * Copyright (C) 2019-2021 Slava Monich <slava@monich.com>
+ * Copyright (C) 2019-2022 Jolla Ltd.
+ * Copyright (C) 2019-2022 Slava Monich <slava@monich.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -977,6 +977,7 @@
bool needTimer() const;
void queueSignal(Signal aSignal);
void emitQueuedSignals();
+ void updateTimer();
void checkTimer();
bool checkPassword(QString aPassword);
bool changePassword(QString aOldPassword, QString aNewPassword);
@@ -1019,8 +1020,7 @@
QList<EncryptTask*> iEncryptTasks;
QList<PasswordTask*> iPasswordTasks;
QTimer* iTimer;
- quint64 iLastTime;
- quint64 iLastPeriod;
+ qint64 iLastPeriod;
uint iTimeLeft;
};
@@ -1039,9 +1039,8 @@
iGenerateKeyTask(NULL),
iDecryptAllTask(NULL),
iTimer(new QTimer(this)),
- iLastTime(QDateTime::currentDateTime().toTime_t()),
- iLastPeriod(iLastTime/FoilAuth::PERIOD),
- iTimeLeft(FoilAuth::PERIOD - (iLastTime % FoilAuth::PERIOD))
+ iLastPeriod(0),
+ iTimeLeft(0)
{
// Serialize the tasks:
iThreadPool->setMaxThreadCount(1);
@@ -1088,6 +1087,10 @@
iTimer->setSingleShot(true);
connect(iTimer, SIGNAL(timeout()), SLOT(onTimer()));
+ updateTimer();
+
+ // Clear queued signals
+ iFirstQueuedSignal = SignalCount;
}
FoilAuthModel::Private::~Private()
@@ -1320,7 +1323,7 @@
void FoilAuthModel::Private::checkTimer()
{
if (needTimer()) {
- onTimer();
+ updateTimer();
} else if (iTimer->isActive()){
queueSignal(SignalTimerActiveChanged);
iTimer->stop();
@@ -1420,7 +1423,8 @@
{
const bool wasBusy = busy();
EncryptTask* task = new EncryptTask(iThreadPool, aData,
- iPrivateKey, iPublicKey, iLastTime, iFoilDataDir);
+ iPrivateKey, iPublicKey, iLastPeriod * FoilAuth::PERIOD,
+ iFoilDataDir);
iEncryptTasks.append(task);
task->submit(this, SLOT(onEncryptTaskDone()));
if (!wasBusy) {
@@ -1474,7 +1478,8 @@
void FoilAuthModel::Private::updatePasswords(const ModelData* aData)
{
const bool wasBusy = busy();
- PasswordTask* task = new PasswordTask(iThreadPool, aData, iLastTime);
+ PasswordTask* task = new PasswordTask(iThreadPool, aData,
+ iLastPeriod * FoilAuth::PERIOD);
iPasswordTasks.append(task);
task->submit(this, SLOT(onPasswordTaskDone()));
if (!wasBusy) {
@@ -1798,18 +1803,18 @@
}
}
-void FoilAuthModel::Private::onTimer()
+void FoilAuthModel::Private::updateTimer()
{
- const QDateTime now(QDateTime::currentDateTime());
- int msec = 1000 - now.time().msec();
- if (msec < 5) msec += 1000;
+ const qint64 msecsSinceEpoch = QDateTime::currentMSecsSinceEpoch();
+ const qint64 secsSinceEpoch = msecsSinceEpoch / 1000;
+ const qint64 thisPeriod = secsSinceEpoch / FoilAuth::PERIOD;
+ const qint64 nextSecond = (secsSinceEpoch + 1) * 1000;
+ const uint lastTimeLeft = iTimeLeft;
+
if (!iTimer->isActive()) {
queueSignal(SignalTimerActiveChanged);
}
- iTimer->start(msec);
- iLastTime = now.toTime_t();
- const quint64 thisPeriod = iLastTime / FoilAuth::PERIOD;
- const uint timeLeft = FoilAuth::PERIOD - (iLastTime % FoilAuth::PERIOD);
+ iTimer->start((int)(nextSecond - msecsSinceEpoch));
if (iLastPeriod != thisPeriod) {
iLastPeriod = thisPeriod;
iTimeLeft = FoilAuth::PERIOD;
@@ -1819,15 +1824,20 @@
updatePasswords(iData.at(i));
}
Q_EMIT parentModel()->timerRestarted();
- } else if (iTimeLeft != timeLeft) {
- iTimeLeft = timeLeft;
+ } else {
+ const qint64 endOfThisPeriod = (thisPeriod + 1) * FoilAuth::PERIOD;
+ iTimeLeft = (int)(endOfThisPeriod - secsSinceEpoch);
+ }
+
+ if (lastTimeLeft != iTimeLeft) {
queueSignal(SignalTimeLeftChanged);
}
+}
+
+void FoilAuthModel::Private::onTimer()
+{
+ updateTimer();
emitQueuedSignals();
- if (iTimeLeft != timeLeft) {
- iTimeLeft = timeLeft;
- Q_EMIT parentModel()->timeLeftChanged();
- }
}
// ==========================================================================
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/src/FoilAuthSettings.cpp
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2019-2021 Jolla Ltd.
- * Copyright (C) 2019-2021 Slava Monich <slava@monich.com>
+ * Copyright (C) 2019-2022 Jolla Ltd.
+ * Copyright (C) 2019-2022 Slava Monich <slava@monich.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -46,6 +46,7 @@
#define KEY_SCAN_WIDE_MODE DCONF_KEY("scanWideMode")
#define KEY_SHARED_KEY_WARNING DCONF_KEY("sharedKeyWarning")
#define KEY_SHARED_KEY_WARNING2 DCONF_KEY("sharedKeyWarning2")
+#define KEY_AUTO_LOCK DCONF_KEY("autoLock")
#define KEY_AUTO_LOCK_TIME DCONF_KEY("autoLockTime")
#define KEY_SAILOTP_IMPORT_DONE DCONF_KEY("sailotpImportDone")
#define KEY_SAILOTP_IMPORTED_TOKENS DCONF_KEY("sailotpImportedTokens")
@@ -55,6 +56,7 @@
#define DEFAULT_SCAN_ZOOM 3.f
#define DEFAULT_SCAN_WIDE_MODE false
#define DEFAULT_SHARED_KEY_WARNING true
+#define DEFAULT_AUTO_LOCK true
#define DEFAULT_AUTO_LOCK_TIME 15000
// ==========================================================================
@@ -74,11 +76,10 @@
MGConfItem* iScanWideMode;
MGConfItem* iSharedKeyWarning;
MGConfItem* iSharedKeyWarning2;
+ MGConfItem* iAutoLock;
MGConfItem* iAutoLockTime;
MGConfItem* iSailotpImportDone;
MGConfItem* iSailotpImportedTokens;
- QVariant iDefaultSharedKeyWarning;
- QVariant iDefaultAutoLockTime;
};
FoilAuthSettings::Private::Private(FoilAuthSettings* aParent) :
@@ -88,11 +89,10 @@
iScanWideMode(new MGConfItem(KEY_SCAN_WIDE_MODE, aParent)),
iSharedKeyWarning(new MGConfItem(KEY_SHARED_KEY_WARNING, aParent)),
iSharedKeyWarning2(new MGConfItem(KEY_SHARED_KEY_WARNING2, aParent)),
+ iAutoLock(new MGConfItem(KEY_AUTO_LOCK, aParent)),
iAutoLockTime(new MGConfItem(KEY_AUTO_LOCK_TIME, aParent)),
iSailotpImportDone(new MGConfItem(KEY_SAILOTP_IMPORT_DONE, aParent)),
- iSailotpImportedTokens(new MGConfItem(KEY_SAILOTP_IMPORTED_TOKENS, aParent)),
- iDefaultSharedKeyWarning(DEFAULT_SHARED_KEY_WARNING),
- iDefaultAutoLockTime(DEFAULT_AUTO_LOCK_TIME)
+ iSailotpImportedTokens(new MGConfItem(KEY_SAILOTP_IMPORTED_TOKENS, aParent))
{
QObject::connect(iQrCodeEcLevel, SIGNAL(valueChanged()),
aParent, SIGNAL(qrCodeEcLevelChanged()));
@@ -106,6 +106,8 @@
aParent, SIGNAL(sharedKeyWarningChanged()));
QObject::connect(iSharedKeyWarning2, SIGNAL(valueChanged()),
aParent, SIGNAL(sharedKeyWarning2Changed()));
+ QObject::connect(iAutoLock, SIGNAL(valueChanged()),
+ aParent, SIGNAL(autoLockChanged()));
QObject::connect(iAutoLockTime, SIGNAL(valueChanged()),
aParent, SIGNAL(autoLockTimeChanged()));
QObject::connect(iSailotpImportDone, SIGNAL(valueChanged()),
@@ -218,13 +220,13 @@
bool
FoilAuthSettings::sharedKeyWarning() const
{
- return iPrivate->iSharedKeyWarning->value(iPrivate->iDefaultSharedKeyWarning).toBool();
+ return iPrivate->iSharedKeyWarning->value(DEFAULT_SHARED_KEY_WARNING).toBool();
}
bool
FoilAuthSettings::sharedKeyWarning2() const
{
- return iPrivate->iSharedKeyWarning2->value(iPrivate->iDefaultSharedKeyWarning).toBool();
+ return iPrivate->iSharedKeyWarning2->value(DEFAULT_SHARED_KEY_WARNING).toBool();
}
void
@@ -243,12 +245,28 @@
iPrivate->iSharedKeyWarning2->set(aValue);
}
+// autoLock
+
+bool
+FoilAuthSettings::autoLock() const
+{
+ return iPrivate->iAutoLock->value(DEFAULT_AUTO_LOCK).toBool();
+}
+
+void
+FoilAuthSettings::setAutoLock(
+ bool aValue)
+{
+ HDEBUG(aValue);
+ iPrivate->iAutoLock->set(aValue);
+}
+
// autoLockTime
int
FoilAuthSettings::autoLockTime() const
{
- QVariant val(iPrivate->iAutoLockTime->value(iPrivate->iDefaultAutoLockTime));
+ QVariant val(iPrivate->iAutoLockTime->value(DEFAULT_AUTO_LOCK_TIME));
bool ok;
const int ival(val.toInt(&ok));
return (ok && ival >= 0) ? ival : DEFAULT_AUTO_LOCK_TIME;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/src/FoilAuthSettings.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2019-2021 Jolla Ltd.
- * Copyright (C) 2019-2021 Slava Monich <slava@monich.com>
+ * Copyright (C) 2019-2022 Jolla Ltd.
+ * Copyright (C) 2019-2022 Slava Monich <slava@monich.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -48,6 +48,7 @@
Q_PROPERTY(bool scanWideMode READ scanWideMode WRITE setScanWideMode NOTIFY scanWideModeChanged)
Q_PROPERTY(bool sharedKeyWarning READ sharedKeyWarning WRITE setSharedKeyWarning NOTIFY sharedKeyWarningChanged)
Q_PROPERTY(bool sharedKeyWarning2 READ sharedKeyWarning2 WRITE setSharedKeyWarning2 NOTIFY sharedKeyWarning2Changed)
+ Q_PROPERTY(bool autoLock READ autoLock WRITE setAutoLock NOTIFY autoLockChanged)
Q_PROPERTY(int autoLockTime READ autoLockTime WRITE setAutoLockTime NOTIFY autoLockTimeChanged)
Q_PROPERTY(bool sailotpImportDone READ sailotpImportDone WRITE setSailotpImportDone NOTIFY sailotpImportDoneChanged)
Q_PROPERTY(QStringList sailotpImportedTokens READ sailotpImportedTokens WRITE setSailotpImportedTokens NOTIFY sailotpImportedTokensChanged)
@@ -76,6 +77,9 @@
void setSharedKeyWarning(bool aValue);
void setSharedKeyWarning2(bool aValue);
+ bool autoLock() const;
+ void setAutoLock(bool aValue);
+
int autoLockTime() const;
void setAutoLockTime(int aValue);
@@ -92,6 +96,7 @@
void scanWideModeChanged();
void sharedKeyWarningChanged();
void sharedKeyWarning2Changed();
+ void autoLockChanged();
void autoLockTimeChanged();
void sailotpImportDoneChanged();
void sailotpImportedTokensChanged();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/translations/harbour-foilauth-de.ts
^
|
@@ -402,6 +402,21 @@
<extracomment>Page header</extracomment>
<translation type="unfinished">Code %1/%2</translation>
</message>
+ <message id="foilauth-settings_page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation type="unfinished">Version %1</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-text">
+ <source>Automatic locking</source>
+ <extracomment>Text switch label</extracomment>
+ <translation type="unfinished">Automatische Sperrung</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-description">
+ <source>Require to enter Foil password after unlocking the screen.</source>
+ <extracomment>Text switch description</extracomment>
+ <translation type="unfinished">Nach dem Entsperren des Bildschirms muss das Foil-Passwort eingegeben werden.</translation>
+ </message>
<message id="jail-explanation">
<source>This application is not designed to function in a sandbox. Try installing the latest version from <b><a href='%1'>OpenRepos</a></b> or <b><a href='%2'>GitHub</a></b>, it may implement some sort of a workaround. No guarantee, though.</source>
<extracomment>Label text explaining the sandbox situation</extracomment>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/translations/harbour-foilauth-fr.ts
^
|
@@ -402,6 +402,21 @@
<extracomment>Page header</extracomment>
<translation type="unfinished">Code %1/%2</translation>
</message>
+ <message id="foilauth-settings_page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation type="unfinished">Version %1</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-text">
+ <source>Automatic locking</source>
+ <extracomment>Text switch label</extracomment>
+ <translation type="unfinished">Verrouillage automatique</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-description">
+ <source>Require to enter Foil password after unlocking the screen.</source>
+ <extracomment>Text switch description</extracomment>
+ <translation type="unfinished">Nécessite d'entrer le mot de passe Foil après avoir déverrouillé l'écran.</translation>
+ </message>
<message id="jail-explanation">
<source>This application is not designed to function in a sandbox. Try installing the latest version from <b><a href='%1'>OpenRepos</a></b> or <b><a href='%2'>GitHub</a></b>, it may implement some sort of a workaround. No guarantee, though.</source>
<extracomment>Label text explaining the sandbox situation</extracomment>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/translations/harbour-foilauth-hu.ts
^
|
@@ -399,6 +399,21 @@
<extracomment>Page header</extracomment>
<translation type="unfinished">Kód %1/%2</translation>
</message>
+ <message id="foilauth-settings_page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation type="unfinished">Verzió %1</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-text">
+ <source>Automatic locking</source>
+ <extracomment>Text switch label</extracomment>
+ <translation type="unfinished">Automatikus lezárás</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-description">
+ <source>Require to enter Foil password after unlocking the screen.</source>
+ <extracomment>Text switch description</extracomment>
+ <translation type="unfinished">A képernyő feloldása után meg kell adnia a Foil jelszót.</translation>
+ </message>
<message id="jail-explanation">
<source>This application is not designed to function in a sandbox. Try installing the latest version from <b><a href='%1'>OpenRepos</a></b> or <b><a href='%2'>GitHub</a></b>, it may implement some sort of a workaround. No guarantee, though.</source>
<extracomment>Label text explaining the sandbox situation</extracomment>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/translations/harbour-foilauth-pl.ts
^
|
@@ -405,6 +405,21 @@
<extracomment>Page header</extracomment>
<translation>Kod %1 z %2</translation>
</message>
+ <message id="foilauth-settings_page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Wersja %1</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-text">
+ <source>Automatic locking</source>
+ <extracomment>Text switch label</extracomment>
+ <translation type="unfinished">Automatyczne blokowanie</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-description">
+ <source>Require to enter Foil password after unlocking the screen.</source>
+ <extracomment>Text switch description</extracomment>
+ <translation type="unfinished">Wymagaj podania Foil hasła po odblokowaniu ekranu.</translation>
+ </message>
<message id="jail-explanation">
<source>This application is not designed to function in a sandbox. Try installing the latest version from <b><a href='%1'>OpenRepos</a></b> or <b><a href='%2'>GitHub</a></b>, it may implement some sort of a workaround. No guarantee, though.</source>
<extracomment>Label text explaining the sandbox situation</extracomment>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/translations/harbour-foilauth-ru.ts
^
|
@@ -405,6 +405,21 @@
<extracomment>Page header</extracomment>
<translation>Код %1 из %2</translation>
</message>
+ <message id="foilauth-settings_page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Версия %1</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-text">
+ <source>Automatic locking</source>
+ <extracomment>Text switch label</extracomment>
+ <translation>Автоматическая блокировка</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-description">
+ <source>Require to enter Foil password after unlocking the screen.</source>
+ <extracomment>Text switch description</extracomment>
+ <translation>Требовать ввода пароля после разблокировки экрана.</translation>
+ </message>
<message id="jail-explanation">
<source>This application is not designed to function in a sandbox. Try installing the latest version from <b><a href='%1'>OpenRepos</a></b> or <b><a href='%2'>GitHub</a></b>, it may implement some sort of a workaround. No guarantee, though.</source>
<extracomment>Label text explaining the sandbox situation</extracomment>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/translations/harbour-foilauth-sv.ts
^
|
@@ -403,6 +403,21 @@
<extracomment>Page header</extracomment>
<translation type="unfinished">Kod %1/%2</translation>
</message>
+ <message id="foilauth-settings_page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Version %1</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-text">
+ <source>Automatic locking</source>
+ <extracomment>Text switch label</extracomment>
+ <translation type="unfinished">Automatisk låsning</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-description">
+ <source>Require to enter Foil password after unlocking the screen.</source>
+ <extracomment>Text switch description</extracomment>
+ <translation type="unfinished">Kräv att ange Foil lösenord efter att ha låst upp skärmen.</translation>
+ </message>
<message id="jail-explanation">
<source>This application is not designed to function in a sandbox. Try installing the latest version from <b><a href='%1'>OpenRepos</a></b> or <b><a href='%2'>GitHub</a></b>, it may implement some sort of a workaround. No guarantee, though.</source>
<extracomment>Label text explaining the sandbox situation</extracomment>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/translations/harbour-foilauth-zh_CN.ts
^
|
@@ -400,6 +400,21 @@
<extracomment>Page header</extracomment>
<translation type="unfinished">代码 %1/%2</translation>
</message>
+ <message id="foilauth-settings_page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation type="unfinished">版本 %1</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-text">
+ <source>Automatic locking</source>
+ <extracomment>Text switch label</extracomment>
+ <translation type="unfinished">自动锁定</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-description">
+ <source>Require to enter Foil password after unlocking the screen.</source>
+ <extracomment>Text switch description</extracomment>
+ <translation type="unfinished">解锁屏幕后需要输入Foil密码。</translation>
+ </message>
<message id="jail-explanation">
<source>This application is not designed to function in a sandbox. Try installing the latest version from <b><a href='%1'>OpenRepos</a></b> or <b><a href='%2'>GitHub</a></b>, it may implement some sort of a workaround. No guarantee, though.</source>
<extracomment>Label text explaining the sandbox situation</extracomment>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-foilauth-1.1.1.tar.gz/translations/harbour-foilauth.ts
^
|
@@ -402,6 +402,21 @@
<extracomment>Page header</extracomment>
<translation>Code %1 of %2</translation>
</message>
+ <message id="foilauth-settings_page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Version %1</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-text">
+ <source>Automatic locking</source>
+ <extracomment>Text switch label</extracomment>
+ <translation>Automatic locking</translation>
+ </message>
+ <message id="foilauth-settings_page-autolock-description">
+ <source>Require to enter Foil password after unlocking the screen.</source>
+ <extracomment>Text switch description</extracomment>
+ <translation>Require to enter Foil password after unlocking the screen.</translation>
+ </message>
<message id="jail-explanation">
<source>This application is not designed to function in a sandbox. Try installing the latest version from <b><a href='%1'>OpenRepos</a></b> or <b><a href='%2'>GitHub</a></b>, it may implement some sort of a workaround. No guarantee, though.</source>
<extracomment>Label text explaining the sandbox situation</extracomment>
|