challenger

OAuth 2.0-based authentication service that validates user can receive messages at a certain address
Log | Files | Refs | Submodules | README | LICENSE

commit 7c5fa0e8899e647a3b5adb00ca1771ffabaa88ec
parent 457da938e38d376a3791a9194d1a31065d55d0d5
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri, 16 Feb 2024 23:47:54 +0100

use https for submodules

Diffstat:
M.gitmodules | 2+-
Mconfigure.ac | 30+++++-------------------------
Mdebian/changelog | 14++++++++++++++
Asrc/challengerdb/challenger_do_validate_and_solve_pin.sql | 78++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 98 insertions(+), 26 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -4,5 +4,5 @@ branch = prebuilt [submodule "contrib/wallet-core"] path = contrib/wallet-core - url = git://git.taler.net/wallet-core + url = https://git.taler.net/wallet-core.git branch = prebuilt diff --git a/configure.ac b/configure.ac @@ -140,16 +140,6 @@ PKG_CHECK_MODULES([JANSSON], [jansson >= 2.3], *** You need libjansson to build this program. ***]])]) -# check for libgnurl -# libgnurl -LIBGNURL_CHECK_CONFIG(,7.34.0,gnurl=1,gnurl=0) -AS_IF([test "x$gnurl" = x1],[ - AM_CONDITIONAL(HAVE_LIBGNURL, true) - AC_DEFINE([HAVE_LIBGNURL],[1],[Have libgnurl]) -],[ - AM_CONDITIONAL(HAVE_LIBGNURL, false) -]) - # libcurl-gnutls LIBCURL_CHECK_CONFIG(,7.34.0,[curl=true],[curl=false]) AS_IF([test "x$curl" = xtrue], @@ -171,22 +161,13 @@ AS_IF([test "x$curl" = xtrue], # HAVE_CURL_CURL_H later (the above LIBCURL_CHECK_CONFIG accepted # *either* header set). AC_CHECK_HEADERS([curl/curl.h],, - curl=false - AC_CHECK_HEADERS([gnurl/curl.h],, - gnurl=false)) + curl=false) # libgnurl -AS_IF([test "x$gnurl" = "x0"], - [AS_IF([test "x$curl" = "x0"], - [AC_MSG_NOTICE([NOTICE: libgnurl not found. taler-bank support will not be compiled.])], - [AC_MSG_NOTICE([WARNING: libgnurl not found, trying to use libcurl-gnutls instead.])])]) - -AS_IF([test x$curl = xfalse], - [AM_CONDITIONAL(HAVE_LIBCURL, false) - AS_IF([test "x$gnurl" = "x0"], - [AC_MSG_WARN([GNU Taler requires libcurl-gnutls >= 7.34])])], - [AM_CONDITIONAL(HAVE_LIBCURL, true) - AC_DEFINE([HAVE_LIBCURL],[1],[Have CURL])]) +AS_IF([test "x$curl" = "x0"], + [AC_MSG_ERROR([libcurl not found..])]) +AM_CONDITIONAL(HAVE_LIBCURL, true) +AC_DEFINE([HAVE_LIBCURL],[1],[Have CURL]) # gcov compilation AC_MSG_CHECKING(whether to compile with support for code coverage analysis) @@ -264,7 +245,6 @@ AM_CONDITIONAL([ENABLE_DOC], [test "x$enable_doc" = "xyes"]) AM_CONDITIONAL([HAVE_GNUNETPQ], [false]) AM_CONDITIONAL([HAVE_POSTGRESQL], [false]) AM_CONDITIONAL([HAVE_LIBCURL], [false]) -AM_CONDITIONAL([HAVE_LIBGNURL], [false]) AM_CONDITIONAL([USE_COVERAGE], [false]) AM_CONDITIONAL([ENABLE_DOC], [true]) diff --git a/debian/changelog b/debian/changelog @@ -1,3 +1,17 @@ +challenger (0.9.5) UNRELEASED; urgency=medium + + [ Christian Grothoff ] + * add ci/ + * improve logging + * -more logging + * bugfixes to error handling + * preparations for #8405 + * -fix typo + * exclude external repos + * -fix codespell CI + + -- root <none> Fri, 16 Feb 2024 22:46:48 +0000 + challenger (0.9.4) unstable; urgency=low * Actual v0.9.4 release. diff --git a/src/challengerdb/challenger_do_validate_and_solve_pin.sql b/src/challengerdb/challenger_do_validate_and_solve_pin.sql @@ -0,0 +1,78 @@ +-- +-- This file is part of TALER +-- Copyright (C) 2024 Taler Systems SA +-- +-- TALER is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 3, or (at your option) any later version. +-- +-- TALER is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +-- A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with +-- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> +-- + +CREATE OR REPLACE FUNCTION challenger_do_validate_and_solve_pin ( + IN in_nonce BYTEA, + IN in_new_pin INT4, + OUT out_not_found BOOLEAN, + OUT out_solved BOOLEAN, + OUT out_address_attempts_left INT4, + OUT out_auth_attempts_left INT4, + OUT out_pin_transmissions_left INT4, + OUT out_client_redirect_uri TEXT) +LANGUAGE plpgsql +AS $$ +DECLARE + my_status RECORD; +BEGIN + +SELECT auth_attempts_left + ,address_attempts_left + ,pin_transmissions_left + ,last_pin + ,client_redirect_uri + INTO my_status + FROM validations + WHERE nonce=in_nonce; + +IF NOT FOUND +THEN + out_not_found=TRUE; + out_solved=FALSE; + out_address_attempts_left=0; + out_auth_attempts_left=0; + out_pin_transmissions_left=0; + out_client_redirect_uri=NULL; + RETURN; +END IF; +out_not_found=FALSE; +out_address_attempts_left=my_status.address_attempts_left; +out_pin_transmissions_left=my_status.pin_transmissions_left; +out_client_redirect_uri=my_status.client_redirect_uri; + +IF (0 = my_status.auth_attempts_left) +THEN + out_solved=FALSE; + out_auth_attempts_left=0; + out_client_redirect_uri=NULL; +END IF; + +out_solved = (last_pin = in_new_pin); + +IF NOT out_solved +THEN + out_auth_attempts_left=my_status.auth_attempts_left-1; +ELSE + out_auth_attempts_left=0; -- solved: no more attempts +END IF; + +UPDATE validations + SET auth_attempts_left=my_status.auth_attempts_left + WHERE nonce=$1; + +RETURN; + +END $$;