summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorÓscar García Amor2021-04-15 18:09:04 +0200
committerÓscar García Amor2021-04-15 18:09:04 +0200
commit641a0f0983f28304958bf5bec803fbe118a7cb63 (patch)
treebf9aeec4e197f967c420f781061627dd643fff9f
parentbe8af7be4fd02177ecb041cceb0138fa5bffb399 (diff)
downloadaur-641a0f0983f28304958bf5bec803fbe118a7cb63.tar.gz
upgpkg: autofirma-bin 1.6.5-4
Add CA in all Firefox profiles
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rw-r--r--autofirma24
3 files changed, 19 insertions, 13 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 37d4d2ccde59..b22cbb30fc90 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = autofirma-bin
pkgdesc = Cliente de firma electrónica ofrecido por la Administración Pública
pkgver = 1.6.5
- pkgrel = 3
+ pkgrel = 4
url = https://firmaelectronica.gob.es/
arch = any
license = GPL
@@ -15,7 +15,7 @@ pkgbase = autofirma-bin
source = autofirma.js
source = autofirma.svg
sha256sums = 28da745ea3084ba87b56eba31bc994e60872384c893c91f3e4aad3db4967d939
- sha256sums = 2a5798fa8d52203a4a6deb6aa50ac1a46974a8104c3c649f15d395e5fdd88cc6
+ sha256sums = ab40c32a083bf6429580b057b21ab8341f8d819cedd91cd52b92fe5ae40212c9
sha256sums = 062cf72219e592e06218e47ea2a212d6517be66f0d4c58dcd03ef18d5c39300b
sha256sums = 428c5b7300dde7158a1a0918c8d2e8188f042dbc143d991c03f51d1c8a40efa4
sha256sums = f7e525586103db08a2a38ccefdef93cc02407728de8b214e53ae3dc0631bab75
diff --git a/PKGBUILD b/PKGBUILD
index cf1ac8f62a55..38e1f1c214f9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=autofirma-bin
pkgver=1.6.5
-pkgrel=3
+pkgrel=4
pkgdesc='Cliente de firma electrónica ofrecido por la Administración Pública'
arch=('any')
url='https://firmaelectronica.gob.es/'
@@ -15,7 +15,7 @@ source=("${pkgname}-${pkgver}.zip::https://sede.xunta.gal/ficheiros/autofirma/Au
"autofirma.js"
"autofirma.svg")
sha256sums=('28da745ea3084ba87b56eba31bc994e60872384c893c91f3e4aad3db4967d939'
- '2a5798fa8d52203a4a6deb6aa50ac1a46974a8104c3c649f15d395e5fdd88cc6'
+ 'ab40c32a083bf6429580b057b21ab8341f8d819cedd91cd52b92fe5ae40212c9'
'062cf72219e592e06218e47ea2a212d6517be66f0d4c58dcd03ef18d5c39300b'
'428c5b7300dde7158a1a0918c8d2e8188f042dbc143d991c03f51d1c8a40efa4'
'f7e525586103db08a2a38ccefdef93cc02407728de8b214e53ae3dc0631bab75')
diff --git a/autofirma b/autofirma
index c64ba1e55fd7..21ae146d9ef4 100644
--- a/autofirma
+++ b/autofirma
@@ -55,19 +55,25 @@ echo "01" > "${_temp_dir}/crlnumber"
}
function trust_ca {
- # Add in shared user database
+ # Add CA in shared user database
certutil -d "${_nssdb}" -D -n "${_cert_cn}" > /dev/null 2>&1
certutil -d "${_nssdb}" -A -i "${_autofirma_ca}" -n "${_cert_cn}" -t C,,
- # Add in default firefox profile (if exists)
+ # Add CA in all firefox profiles (if any)
if [ -r "${_firefox_profiles_ini}" ]; then
- _firefox_default_profile="$(grep Default ${_firefox_profiles_ini})"
- _firefox_default_profile_dir="${HOME}/.mozilla/firefox/${_firefox_default_profile##*=}"
- if [ -d "${_firefox_default_profile_dir}" ]; then
- certutil -d "${_firefox_default_profile_dir}" -D -n "${_cert_cn}" > /dev/null 2>&1
- certutil -d "${_firefox_default_profile_dir}" -A -i "${_autofirma_ca}" -n "${_cert_cn}" -t C,,
- fi
+ _firefox_profile_paths=($(grep Path ${_firefox_profiles_ini}))
+ for _firefox_profile_path in ${_firefox_profile_paths[@]}; do
+ _firefox_profile_path="${_firefox_profile_path##*=}"
+ # Check if profile path is absolute or relative
+ [ ! -d "${_firefox_profile_path}" ] && \
+ _firefox_profile_path="${HOME}/.mozilla/firefox/${_firefox_profile_path}"
+ # Add CA in current firefox profile
+ if [ -d "${_firefox_profile_path}" ]; then
+ certutil -d "${_firefox_profile_path}" -D -n "${_cert_cn}" > /dev/null 2>&1
+ certutil -d "${_firefox_profile_path}" -A -i "${_autofirma_ca}" -n "${_cert_cn}" -t C,,
+ fi
+ done
unset _autofirma_ca _autofirma_pfx _cert_cn _nssdb \
- _firefox_profiles_ini _firefox_default_profile _firefox_default_profile_dir
+ _firefox_profiles_ini _firefox_profile_paths _firefox_profile_path
fi
}