diff --git a/CHANGELOG.md b/CHANGELOG.md index 2826aafe..4ea33b07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ From the first test on a DNR-322L ([#180](https://github.com/UniqueDroid/ShareOS - **First installation from a partitioned USB stick:** the search now looks again for a few seconds when it finds nothing (a stick's partitions can show up after the stick itself) and logs every drive and partition it tried and why it was skipped. A failure on GitHub says that the stick was searched too. - **DHCP waits for the link.** The system asked for DHCP for about 9 s; on the DNR-322L the link comes up about 12 s after boot, so the box ended up on the fallback address 192.168.0.32. It now waits up to 20 s for the link first and logs how long it took. - *Shares* and *Users*: a share named like an account with a personal folder (possible before 0.3.0-beta.14 refused such names) takes the address `\\box\` over SMB, so the personal folder cannot be reached there. Both lists now say so at the share and at the account, with what to do: create the share again under another name. +- **Signed app catalog.** The store catalog lists the checksum of every package, so whoever could change it could swap a package. The apps repository now signs `index.json` with its own key, and the box uses the official catalog only with a valid signature (otherwise the store shows the error at the source). Sources you add yourself still work: their apps are marked *not signed by the ShareOS project*, need a confirmation and install as not checked. - *Storage → Drives*: formatting a USB drive could fail right after partitioning ("creating the file system failed") – the new partition can disappear for a moment while the kernel reads the partition table again. It now waits until the partition can be opened and tries once more, as setting up internal drives already did. ## 0.3.0-beta.15 diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 8cb1cca7..2bdd240d 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -42,6 +42,26 @@ the public key in the firmware (`src/shareos-core/etc/shareos/release.pub`). openssl ecparam -name prime256v1 -genkey -noout -out shareos-release.key openssl ec -in shareos-release.key -pubout -out shareos-release.pub +### App catalog + +The store reads `index.json` from the release `catalog` of +[ShareOS-Apps](https://github.com/UniqueDroid/ShareOS-Apps). It lists the +checksum of every package, so it is signed too: the apps workflow writes +`index.json.sig` with its own key (secret `CATALOG_SIGNING_KEY` of the +environment `catalog` in the apps repository; offline copy with Jan). Boxes +check it against `src/shareos-core/etc/shareos/catalog.pub` or, in an +emergency, the release reserve key. + +- From 0.3.0-beta.16 a box refuses the official catalog without a valid + signature (the store shows the error at the source). Other sources a user + adds still work; their apps are marked *not signed by the ShareOS project* + and install as not checked, after a confirmation. +- Catalog key lost or exposed: sign with the release reserve key (boxes accept + it at once), then put a new `catalog.pub` into the firmware and release it. + + openssl ecparam -name prime256v1 -genkey -noout -out shareos-catalog.key + openssl ec -in shareos-catalog.key -pubout -out shareos-catalog.pub + The website ([uniquedroid.github.io/ShareOS](https://uniquedroid.github.io/ShareOS/), built from `website/` and the docs) rebuilds itself when the release build has finished; nothing to do by hand. diff --git a/src/shareos-core/etc/shareos/catalog.pub b/src/shareos-core/etc/shareos/catalog.pub new file mode 100644 index 00000000..273405a8 --- /dev/null +++ b/src/shareos-core/etc/shareos/catalog.pub @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0FomwK942XHmcSZJvtcv2V/vKppc +60YPwpL3fhVH//57YPeT7G16zl89l9EeqnB/S4f41gp4IaJKpJMGTOEybw== +-----END PUBLIC KEY----- diff --git a/src/shareos-core/parts/web/apps.js b/src/shareos-core/parts/web/apps.js index 6697855c..b52d0763 100644 --- a/src/shareos-core/parts/web/apps.js +++ b/src/shareos-core/parts/web/apps.js @@ -239,14 +239,14 @@ function appInstalled() { return html`${favBar(list)}${rec}
${secHead('apps', 'INSTALLED APPS', list.length ? `${list.length}` : '')} ${!list.length ? html`
${svg(I.box)}No app installed yet. The store has apps to install – or upload your own package (.sapp).
` : t ? html`
- ${list.map((a) => html` + ${list.map((a) => html``)}
APPVERSIONPUBLISHERVISIBLE TO
${appIcon(a)}${a.name} ${favStar(a)}${a.verified ? '' : html` uploaded`}
${txtOf(a.description)}
${appIcon(a)}${a.name} ${favStar(a)}${a.verified ? '' : html` ${a.source ? 'not signed by the ShareOS project' : 'uploaded'}`}
${txtOf(a.description)}
${a.version}${upd(a) ? html` → ${upd(a).latest}` : ''}${a.publisher}${appUsersTxt(a)} ${appActions(a, upd(a))}
` : html`
${list.map((a) => html`
${favStar(a)}
${appIcon(a)}
${a.name} ${a.version}
${txtOf(a.description)}
-
${a.verified ? 'from the store' : 'uploaded – not checked'} ${upd(a) ? html`Update ${upd(a).latest}` : ''}
+
${a.verified ? 'from the store' : a.source ? 'not signed by the ShareOS project' : 'uploaded – not checked'} ${upd(a) ? html`Update ${upd(a).latest}` : ''}
${permTags(appPerms(a))}
${a.publisher} · ${a.module ? html`Module` : a.type === 'system' ? html`Command ${sysCmds(a)}` : 'visible to ' + appUsersTxt(a)}
${appActions(a, upd(a))}
`)}
`} @@ -351,7 +351,7 @@ function appStore() { for (const a of list) { const v = a.versions[0]; rows.push(html`${appIcon(a)} - ${a.name}${a.category ? html` ${APP_CAT[a.category] || a.category}` : ''}
${txtOf(a.description)}
${permTags(appPerms({ ...v, type: a.type, module: a.module }))} + ${a.name}${a.category ? html` ${APP_CAT[a.category] || a.category}` : ''}${a.signed === false ? html` not signed by the ShareOS project` : ''}
${txtOf(a.description)}
${permTags(appPerms({ ...v, type: a.type, module: a.module }))} ${v.version}${v.prerelease ? html` BETA` : ''} ${a.publisher}${fmtDate(v.date)}${fmtBytes(v.size)} ${a.installed && !a.update_available ? html`installed` @@ -466,6 +466,10 @@ Object.assign(ACTIONS, { const need = (v?.requires || c?.requires || []).filter((r) => !have.has(r)); // one text node per sentence, so each is translated const parts = [...perms.map((p) => PERM_TXT[p] || p), ...(need.length ? [`Also installed: ${need.join(', ')}.`] : [])]; + // a source without a valid signature of the project: the checksum only shows + // that the download is complete, not who made the package + if (c?.signed === false && !await confirmDlg('Install from an unsigned source?', + raw(html`This app comes from a store source without a valid signature of the ShareOS project. Its checksum only shows that the download is complete – not who made it.`.s), 'Install', true)) return; if (parts.length && !await confirmDlg(`${c.name}: permissions`, raw(html`${parts.map((t) => html`${t} `)}`.s), 'Allow & install')) return; try { await rpc('shareos.apps', 'install', { id: el.dataset.id, version: el.dataset.v }); diff --git a/src/shareos-core/usr/sbin/shareos-apps b/src/shareos-core/usr/sbin/shareos-apps index d7b2a750..0bdab9d0 100755 --- a/src/shareos-core/usr/sbin/shareos-apps +++ b/src/shareos-core/usr/sbin/shareos-apps @@ -95,6 +95,13 @@ // 8081) from /www-apps// – another origin than the admin interface, so an // app cannot use the admin's login. // +// Signature of a catalog: .sig next to index.json, ECDSA P-256 over the +// file (openssl dgst -sha256 -sign), checked with pk_verify of mbedtls against +// /etc/shareos/catalog.pub (the key of the app repository) or the reserve key +// of the firmware releases. The official source must carry a valid one – a +// catalog lists the checksums of the packages, so whoever can change it can +// swap a package. Other sources still work; their apps count as not checked. +// // Catalog (index.json, one URL per source in apps.store.source): // { "schema": 1, "apps": [ { "id", "name", "publisher", "description", // "category", "icon_url", "homepage", "type", @@ -130,6 +137,9 @@ const MAX_REQUIRES = 5; const MAX_LOG = 65536; // the test suite serves catalogs and packages from files const URL_RE = getenv('SHAREOS_APPS_ALLOW_FILE') ? /^(https|file):\/\// : /^https:\/\//; +const CAT_KEYS = [ ROOT + '/etc/shareos/catalog.pub', ROOT + '/etc/shareos/release-reserve.pub' ]; +// the source that must be signed (the test suite names its own) +const OFFICIAL = getenv('SHAREOS_APPS_OFFICIAL') ?? 'https://github.com/UniqueDroid/ShareOS-Apps/releases/download/catalog/index.json'; function shq(s) { return "'" + replace(s, "'", "'\\''") + "'"; } @@ -461,14 +471,45 @@ function installed() { /* ---------- catalog ---------- */ -function fetch_catalog(url) { - let r = capture(join(' ', map([ ...CURL, '--max-time', '20', url ], shq))); +// the keys a catalog can be signed with (none: firmware without catalog key) +function cat_keys() { + return filter(CAT_KEYS, (k) => index(readfile(k) ?? '', 'BEGIN PUBLIC KEY') >= 0); +} + +// is .sig a valid signature of ? (pk_verify reads ".sig") +function cat_signed(file) { + if (!stat(file + '.sig')) return false; + for (let prog in [ 'mbedtls_pk_verify', 'pk_verify' ]) + if (capture('command -v ' + prog).rc == 0) { + for (let key in cat_keys()) + if (capture(join(' ', map([ prog, key, file ], shq))).rc == 0) + return true; + return false; + } + return false; +} + +function fetch_catalog(url, n) { + mkdir(ST); + let f = ST + '/cat-' + n + '.json'; + unlink(f); unlink(f + '.sig'); + let r = capture(join(' ', map([ ...CURL, '--max-time', '20', '-o', f, url ], shq))); if (r.rc != 0) { + unlink(f); let m = match(r.out, /curl: \([0-9]+\)[^\n]*/); return { error: m ? m[0] : 'curl exit ' + r.rc }; } - let d = jparse(r.out); - if (type(d) != 'object' || type(d.apps) != 'array') return { error: 'not a ShareOS app catalog' }; + let d = jparse(readfile(f) ?? ''); + if (type(d) != 'object' || type(d.apps) != 'array') { unlink(f); return { error: 'not a ShareOS app catalog' }; } + // the signature checks the file as downloaded, before anything of it is used + if (capture(join(' ', map([ ...CURL, '--max-time', '20', '-o', f + '.sig', url + '.sig' ], shq))).rc != 0) + unlink(f + '.sig'); + let signed = cat_signed(f); + unlink(f); unlink(f + '.sig'); + // enforced once the firmware carries the key of the app repository + if (!signed && url == OFFICIAL && index(readfile(CAT_KEYS[0]) ?? '', 'BEGIN PUBLIC KEY') >= 0) + return { error: 'catalog signature missing or invalid – not used' }; + d.signed = signed; return d; } @@ -485,7 +526,7 @@ function merge(catalogs, channel) { let i = inst[a.id]; push(apps, { id: a.id, name: a.name ?? a.id, publisher: a.publisher ?? '', description: a.description ?? '', category: a.category ?? '', icon_url: a.icon_url ?? null, homepage: a.homepage ?? '', - type: a.type ?? 'webapp', module: a.type == 'system' && a.module == a.id ? a.id : null, source: cat.url, versions: vs, latest: vs[0].version, requires: vs[0].requires ?? [], + type: a.type ?? 'webapp', module: a.type == 'system' && a.module == a.id ? a.id : null, source: cat.url, signed: cat.signed === true, versions: vs, latest: vs[0].version, requires: vs[0].requires ?? [], installed: i?.version ?? null, update_available: !!i && vcmp(vs[0].version, i.version) > 0, compatible: !too_old(vs[0].min_shareos) }); @@ -497,8 +538,9 @@ function merge(catalogs, channel) { function cmd_catalog() { let K = conf(), channel = K.channel, sources = K.sources; let cats = [], errors = []; + let n = 0; for (let u in sources) { - let d = fetch_catalog(u); + let d = fetch_catalog(u, n++); if (d.error) push(errors, { source: u, error: d.error }); else push(cats, { ...d, url: u }); } @@ -866,7 +908,8 @@ function install_catalog(id, version, depth) { let sum = split(trim(capture('sha256sum ' + shq(f)).out), ' ')[0]; if (sum != v.sha256) { unlink(f); return { error: 'checksum mismatch – package not installed' }; } job({ state: 'installing', id, version: v.version }); - let res = install_file(f, true, app.source); + // an app from a source without a valid signature is not checked either + let res = install_file(f, app.signed, app.source); unlink(f); if (res.error) return res; if (res.id != id) return { error: 'package contains another app (' + res.id + ')' }; diff --git a/src/shareos-core/www/i18n/ar.json b/src/shareos-core/www/i18n/ar.json index 8a21e911..93d92018 100644 --- a/src/shareos-core/www/i18n/ar.json +++ b/src/shareos-core/www/i18n/ar.json @@ -1735,7 +1735,11 @@ "from the app repository). Uploaded packages are marked “uploaded – not checked”: the box cannot compare them with the store.": "من مستودع التطبيقات). تُعلَّم الحزم المرفوعة بـ«مرفوع – غير مُتحقَّق منه»: لا يستطيع الجهاز مقارنتها بالمتجر.", "Signed in": "تم تسجيل الدخول", "Over SMB a share of the same name opens instead of this personal folder – create that share again under another name.": "عبر SMB تُفتح مشاركة بالاسم نفسه بدلاً من هذا المجلد الشخصي – أنشئ تلك المشاركة من جديد باسم آخر.", - "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "عبر SMB تُخفي هذه المشاركة المجلد الشخصي للحساب الذي يحمل الاسم نفسه – أنشئها من جديد باسم آخر لتحرير هذا العنوان." + "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "عبر SMB تُخفي هذه المشاركة المجلد الشخصي للحساب الذي يحمل الاسم نفسه – أنشئها من جديد باسم آخر لتحرير هذا العنوان.", + "Install from an unsigned source?": "التثبيت من مصدر غير موقَّع؟", + "This app comes from a store source without a valid signature of the ShareOS project.": "يأتي هذا التطبيق من مصدر متجر بلا توقيع صالح من مشروع ShareOS.", + "Its checksum only shows that the download is complete – not who made it.": "مجموع التحقق يبيّن فقط أن التنزيل مكتمل – لا من صنعه.", + "catalog signature missing or invalid – not used": "توقيع الكتالوج مفقود أو غير صالح – لم يُستخدم" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/bn.json b/src/shareos-core/www/i18n/bn.json index a7dc3dd1..c892a8ce 100644 --- a/src/shareos-core/www/i18n/bn.json +++ b/src/shareos-core/www/i18n/bn.json @@ -1735,7 +1735,11 @@ "from the app repository). Uploaded packages are marked “uploaded – not checked”: the box cannot compare them with the store.": "দিয়ে তৈরি)। আপলোড করা প্যাকেজ \"আপলোড করা – যাচাই করা হয়নি\" হিসেবে চিহ্নিত: বক্সটি এগুলো স্টোরের সঙ্গে মেলাতে পারে না।", "Signed in": "সাইন ইন করা", "Over SMB a share of the same name opens instead of this personal folder – create that share again under another name.": "SMB-তে এই ব্যক্তিগত ফোল্ডারের বদলে একই নামের একটি শেয়ার খোলে – সেই শেয়ারটি অন্য নামে আবার তৈরি করুন।", - "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "SMB-তে এই শেয়ারটি একই নামের অ্যাকাউন্টের ব্যক্তিগত ফোল্ডার আড়াল করে – সেই ঠিকানা মুক্ত করতে এটি অন্য নামে আবার তৈরি করুন।" + "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "SMB-তে এই শেয়ারটি একই নামের অ্যাকাউন্টের ব্যক্তিগত ফোল্ডার আড়াল করে – সেই ঠিকানা মুক্ত করতে এটি অন্য নামে আবার তৈরি করুন।", + "Install from an unsigned source?": "স্বাক্ষরবিহীন উৎস থেকে ইনস্টল করবেন?", + "This app comes from a store source without a valid signature of the ShareOS project.": "এই অ্যাপটি এমন একটি স্টোর উৎস থেকে এসেছে যাতে ShareOS প্রকল্পের কোনো বৈধ স্বাক্ষর নেই।", + "Its checksum only shows that the download is complete – not who made it.": "এর চেকসাম শুধু দেখায় যে ডাউনলোড সম্পূর্ণ – কে এটি তৈরি করেছে তা নয়।", + "catalog signature missing or invalid – not used": "ক্যাটালগের স্বাক্ষর নেই বা অবৈধ – ব্যবহার করা হয়নি" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/de.json b/src/shareos-core/www/i18n/de.json index b904edbe..2a857b57 100644 --- a/src/shareos-core/www/i18n/de.json +++ b/src/shareos-core/www/i18n/de.json @@ -1735,7 +1735,11 @@ "from the app repository). Uploaded packages are marked “uploaded – not checked”: the box cannot compare them with the store.": "aus dem App-Repo). Hochgeladene Pakete sind als „hochgeladen – nicht geprüft“ markiert: Die Box kann sie nicht mit dem Store vergleichen.", "Signed in": "Angemeldet", "Over SMB a share of the same name opens instead of this personal folder – create that share again under another name.": "Über SMB öffnet sich statt dieses persönlichen Ordners eine Freigabe gleichen Namens – lege diese Freigabe unter einem anderen Namen neu an.", - "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "Über SMB verdeckt diese Freigabe den persönlichen Ordner des gleichnamigen Kontos – lege sie unter einem anderen Namen neu an, um diese Adresse freizugeben." + "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "Über SMB verdeckt diese Freigabe den persönlichen Ordner des gleichnamigen Kontos – lege sie unter einem anderen Namen neu an, um diese Adresse freizugeben.", + "Install from an unsigned source?": "Aus einer nicht signierten Quelle installieren?", + "This app comes from a store source without a valid signature of the ShareOS project.": "Diese App stammt aus einer Store-Quelle ohne gültige Signatur des ShareOS-Projekts.", + "Its checksum only shows that the download is complete – not who made it.": "Ihre Prüfsumme zeigt nur, dass der Download vollständig ist – nicht, wer sie gemacht hat.", + "catalog signature missing or invalid – not used": "Katalog-Signatur fehlt oder ist ungültig – nicht verwendet" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/es.json b/src/shareos-core/www/i18n/es.json index adf3147e..b146ca8d 100644 --- a/src/shareos-core/www/i18n/es.json +++ b/src/shareos-core/www/i18n/es.json @@ -1735,7 +1735,11 @@ "from the app repository). Uploaded packages are marked “uploaded – not checked”: the box cannot compare them with the store.": "del repositorio de apps). Los paquetes subidos se marcan como «subida – sin verificar»: el equipo no puede compararlos con la tienda.", "Signed in": "Sesión iniciada", "Over SMB a share of the same name opens instead of this personal folder – create that share again under another name.": "Por SMB se abre un recurso compartido con el mismo nombre en lugar de esta carpeta personal: vuelve a crear ese recurso con otro nombre.", - "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "Por SMB este recurso compartido oculta la carpeta personal de la cuenta con el mismo nombre: vuelve a crearlo con otro nombre para liberar esa dirección." + "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "Por SMB este recurso compartido oculta la carpeta personal de la cuenta con el mismo nombre: vuelve a crearlo con otro nombre para liberar esa dirección.", + "Install from an unsigned source?": "¿Instalar desde una fuente sin firmar?", + "This app comes from a store source without a valid signature of the ShareOS project.": "Esta app procede de una fuente de la tienda sin una firma válida del proyecto ShareOS.", + "Its checksum only shows that the download is complete – not who made it.": "Su suma de comprobación solo muestra que la descarga está completa, no quién la hizo.", + "catalog signature missing or invalid – not used": "falta la firma del catálogo o no es válida – no se usa" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/fr.json b/src/shareos-core/www/i18n/fr.json index 536d8f26..51f23f85 100644 --- a/src/shareos-core/www/i18n/fr.json +++ b/src/shareos-core/www/i18n/fr.json @@ -1735,7 +1735,11 @@ "from the app repository). Uploaded packages are marked “uploaded – not checked”: the box cannot compare them with the store.": "depuis le dépôt d'apps). Les paquets téléversés sont marqués « téléversée – non vérifiée » : la box ne peut pas les comparer au store.", "Signed in": "Connecté", "Over SMB a share of the same name opens instead of this personal folder – create that share again under another name.": "En SMB, un partage du même nom s’ouvre à la place de ce dossier personnel – recréez ce partage sous un autre nom.", - "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "En SMB, ce partage masque le dossier personnel du compte du même nom – recréez-le sous un autre nom pour libérer cette adresse." + "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "En SMB, ce partage masque le dossier personnel du compte du même nom – recréez-le sous un autre nom pour libérer cette adresse.", + "Install from an unsigned source?": "Installer depuis une source non signée ?", + "This app comes from a store source without a valid signature of the ShareOS project.": "Cette application provient d’une source du store sans signature valide du projet ShareOS.", + "Its checksum only shows that the download is complete – not who made it.": "Sa somme de contrôle montre seulement que le téléchargement est complet – pas qui l’a créée.", + "catalog signature missing or invalid – not used": "signature du catalogue absente ou invalide – non utilisé" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/hi.json b/src/shareos-core/www/i18n/hi.json index 45c26de9..aa28caf8 100644 --- a/src/shareos-core/www/i18n/hi.json +++ b/src/shareos-core/www/i18n/hi.json @@ -1735,7 +1735,11 @@ "from the app repository). Uploaded packages are marked “uploaded – not checked”: the box cannot compare them with the store.": "से बने)। अपलोड किए पैकेज \"अपलोड किया – जाँचा नहीं गया\" चिह्नित होते हैं: बॉक्स उन्हें स्टोर से मिला नहीं सकता।", "Signed in": "साइन इन", "Over SMB a share of the same name opens instead of this personal folder – create that share again under another name.": "SMB पर इस निजी फ़ोल्डर के बजाय उसी नाम का शेयर खुलता है – उस शेयर को किसी दूसरे नाम से दोबारा बनाएँ।", - "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "SMB पर यह शेयर उसी नाम वाले खाते के निजी फ़ोल्डर को छिपा देता है – उस पते को मुक्त करने के लिए इसे किसी दूसरे नाम से दोबारा बनाएँ।" + "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "SMB पर यह शेयर उसी नाम वाले खाते के निजी फ़ोल्डर को छिपा देता है – उस पते को मुक्त करने के लिए इसे किसी दूसरे नाम से दोबारा बनाएँ।", + "Install from an unsigned source?": "बिना हस्ताक्षर वाले स्रोत से इंस्टॉल करें?", + "This app comes from a store source without a valid signature of the ShareOS project.": "यह ऐप ऐसे स्टोर स्रोत से है जिस पर ShareOS प्रोजेक्ट का कोई मान्य हस्ताक्षर नहीं है।", + "Its checksum only shows that the download is complete – not who made it.": "इसका चेकसम केवल यह दिखाता है कि डाउनलोड पूरा है – यह नहीं कि इसे किसने बनाया।", + "catalog signature missing or invalid – not used": "कैटलॉग हस्ताक्षर नहीं है या अमान्य है – उपयोग नहीं किया गया" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/pt.json b/src/shareos-core/www/i18n/pt.json index 443f39e7..8ba09538 100644 --- a/src/shareos-core/www/i18n/pt.json +++ b/src/shareos-core/www/i18n/pt.json @@ -1735,7 +1735,11 @@ "from the app repository). Uploaded packages are marked “uploaded – not checked”: the box cannot compare them with the store.": "do repositório de apps). Pacotes enviados são marcados como \"enviado – não verificado\": o aparelho não consegue compará-los com a loja.", "Signed in": "Conectado", "Over SMB a share of the same name opens instead of this personal folder – create that share again under another name.": "Por SMB abre-se uma partilha com o mesmo nome em vez desta pasta pessoal – crie essa partilha de novo com outro nome.", - "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "Por SMB esta partilha oculta a pasta pessoal da conta com o mesmo nome – crie-a de novo com outro nome para libertar esse endereço." + "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "Por SMB esta partilha oculta a pasta pessoal da conta com o mesmo nome – crie-a de novo com outro nome para libertar esse endereço.", + "Install from an unsigned source?": "Instalar a partir de uma fonte não assinada?", + "This app comes from a store source without a valid signature of the ShareOS project.": "Esta app vem de uma fonte da loja sem uma assinatura válida do projeto ShareOS.", + "Its checksum only shows that the download is complete – not who made it.": "A sua soma de verificação só mostra que a transferência está completa – não quem a fez.", + "catalog signature missing or invalid – not used": "assinatura do catálogo em falta ou inválida – não usado" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/ru.json b/src/shareos-core/www/i18n/ru.json index 238a9ba9..6f01a6b5 100644 --- a/src/shareos-core/www/i18n/ru.json +++ b/src/shareos-core/www/i18n/ru.json @@ -1735,7 +1735,11 @@ "from the app repository). Uploaded packages are marked “uploaded – not checked”: the box cannot compare them with the store.": "из репозитория приложений). Загруженные пакеты помечаются «загружено – не проверено»: устройство не может сравнить их с магазином.", "Signed in": "Вход выполнен", "Over SMB a share of the same name opens instead of this personal folder – create that share again under another name.": "По SMB вместо этой личной папки открывается общая папка с тем же именем – создайте эту общую папку заново под другим именем.", - "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "По SMB эта общая папка скрывает личную папку учётной записи с тем же именем – создайте её заново под другим именем, чтобы освободить этот адрес." + "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "По SMB эта общая папка скрывает личную папку учётной записи с тем же именем – создайте её заново под другим именем, чтобы освободить этот адрес.", + "Install from an unsigned source?": "Установить из неподписанного источника?", + "This app comes from a store source without a valid signature of the ShareOS project.": "Это приложение получено из источника магазина без действительной подписи проекта ShareOS.", + "Its checksum only shows that the download is complete – not who made it.": "Его контрольная сумма показывает лишь, что загрузка завершена, но не то, кто его создал.", + "catalog signature missing or invalid – not used": "подпись каталога отсутствует или недействительна – не используется" }, "patterns": [ [ diff --git a/src/shareos-core/www/i18n/zh.json b/src/shareos-core/www/i18n/zh.json index 3acf5d54..2265d48b 100644 --- a/src/shareos-core/www/i18n/zh.json +++ b/src/shareos-core/www/i18n/zh.json @@ -1735,7 +1735,11 @@ "from the app repository). Uploaded packages are marked “uploaded – not checked”: the box cannot compare them with the store.": "构建)。上传的软件包标记为“已上传 – 未校验”:设备无法将其与商店比对。", "Signed in": "已登录", "Over SMB a share of the same name opens instead of this personal folder – create that share again under another name.": "通过 SMB 打开的是同名共享,而不是此个人文件夹——请用其他名称重新创建该共享。", - "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "通过 SMB,此共享会遮住同名账户的个人文件夹——请用其他名称重新创建它,以释放该地址。" + "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.": "通过 SMB,此共享会遮住同名账户的个人文件夹——请用其他名称重新创建它,以释放该地址。", + "Install from an unsigned source?": "从未签名的来源安装?", + "This app comes from a store source without a valid signature of the ShareOS project.": "此应用来自没有 ShareOS 项目有效签名的商店来源。", + "Its checksum only shows that the download is complete – not who made it.": "其校验和只表明下载完整,并不能说明是谁制作的。", + "catalog signature missing or invalid – not used": "目录签名缺失或无效——未使用" }, "patterns": [ [ diff --git a/tests/test-apps.sh b/tests/test-apps.sh index 4e000bc9..c8d1b8c0 100755 --- a/tests/test-apps.sh +++ b/tests/test-apps.sh @@ -87,6 +87,23 @@ print(json.dumps({"schema": 1, "apps": [ PY run "uci -q delete apps.store.source; uci add_list apps.store.source=file:///tmp/pkg/index.json; uci set apps.store.port=$PORT; uci set apps.store.https_port=$((PORT+1)); uci set shareos.web.https=0; uci commit apps; uci commit shareos" >/dev/null +# the catalog is signed with a test key, as the app repository signs index.json +openssl ecparam -name prime256v1 -genkey -noout -out $T/cat.key 2>/dev/null +mkdir -p $R/etc/shareos; openssl ec -in $T/cat.key -pubout -out $R/etc/shareos/catalog.pub 2>/dev/null +sign_cat() { openssl dgst -sha256 -sign $T/cat.key -out $P/index.json.sig $P/index.json; } +sign_cat +runoff() { chroot "$R" /usr/bin/env SHAREOS_APPS_ALLOW_FILE=1 SHAREOS_APPS_OFFICIAL=file:///tmp/pkg/index.json /bin/sh -c "$*" 2>&1; } +check "signed catalog: the official source is used, its apps count as signed" "runoff 'shareos-apps catalog' | js \"not d['errors'] and d['apps'] and all(a['signed'] for a in d['apps'])\"" +mv $P/index.json.sig $T/sig.ok +check "signed catalog: the official source without .sig is refused" "runoff 'shareos-apps catalog' | js \"d['apps']==[] and 'signature' in d['errors'][0]['error']\"" +echo '{"apps":[]}' > $T/other.json; openssl dgst -sha256 -sign $T/cat.key -out $P/index.json.sig $T/other.json +check "signed catalog: a signature of another file is refused" "runoff 'shareos-apps catalog' | js \"d['apps']==[] and 'signature' in d['errors'][0]['error']\"" +openssl ecparam -name prime256v1 -genkey -noout -out $T/evil.key 2>/dev/null; openssl dgst -sha256 -sign $T/evil.key -out $P/index.json.sig $P/index.json +check "signed catalog: a signature with another key is refused" "runoff 'shareos-apps catalog' | js \"d['apps']==[] and 'signature' in d['errors'][0]['error']\"" +check "signed catalog: another source without a valid signature still works, its apps not signed" "run 'shareos-apps catalog' | js \"not d['errors'] and d['apps'] and not any(a['signed'] for a in d['apps'])\"" +check "signed catalog: an app from such a source installs as not checked" "run 'shareos-apps install helper' | js \"d['ok'] and not d['verified']\" && run 'shareos-apps remove helper' | js \"d.get('ok')\"" +mv $T/sig.ok $P/index.json.sig + C=$(run "shareos-apps catalog") check "catalog: stable channel shows release versions only" "echo '$C' | js \"[(a['id'],a['latest']) for a in d['apps']]==[('broken','1.0.0'),('hello','1.0.0'),('helper','1.0.0'),('nanox','1.0.0'),('needy','1.0.0'),('paperless','1.0.0')]\"" check "catalog: a module keeps its field, only with its own id" "echo '$C' | js \"{a['id']:a['module'] for a in d['apps'] if a['type']=='system'}=={'paperless':'paperless','nanox':None} and all(a['module'] is None for a in d['apps'] if a['type']!='system')\"" diff --git a/tools/i18n/ar.tsv b/tools/i18n/ar.tsv index 796fc9a2..2c72f037 100644 --- a/tools/i18n/ar.tsv +++ b/tools/i18n/ar.tsv @@ -2193,3 +2193,7 @@ E1749 من مستودع التطبيقات). تُعلَّم الحزم المر E1750 تم تسجيل الدخول E1751 عبر SMB تُفتح مشاركة بالاسم نفسه بدلاً من هذا المجلد الشخصي – أنشئ تلك المشاركة من جديد باسم آخر. E1752 عبر SMB تُخفي هذه المشاركة المجلد الشخصي للحساب الذي يحمل الاسم نفسه – أنشئها من جديد باسم آخر لتحرير هذا العنوان. +E1753 التثبيت من مصدر غير موقَّع؟ +E1754 يأتي هذا التطبيق من مصدر متجر بلا توقيع صالح من مشروع ShareOS. +E1755 مجموع التحقق يبيّن فقط أن التنزيل مكتمل – لا من صنعه. +E1756 توقيع الكتالوج مفقود أو غير صالح – لم يُستخدم diff --git a/tools/i18n/bn.tsv b/tools/i18n/bn.tsv index d8139c68..609d2196 100644 --- a/tools/i18n/bn.tsv +++ b/tools/i18n/bn.tsv @@ -2193,3 +2193,7 @@ E1749 দিয়ে তৈরি)। আপলোড করা প্যাক E1750 সাইন ইন করা E1751 SMB-তে এই ব্যক্তিগত ফোল্ডারের বদলে একই নামের একটি শেয়ার খোলে – সেই শেয়ারটি অন্য নামে আবার তৈরি করুন। E1752 SMB-তে এই শেয়ারটি একই নামের অ্যাকাউন্টের ব্যক্তিগত ফোল্ডার আড়াল করে – সেই ঠিকানা মুক্ত করতে এটি অন্য নামে আবার তৈরি করুন। +E1753 স্বাক্ষরবিহীন উৎস থেকে ইনস্টল করবেন? +E1754 এই অ্যাপটি এমন একটি স্টোর উৎস থেকে এসেছে যাতে ShareOS প্রকল্পের কোনো বৈধ স্বাক্ষর নেই। +E1755 এর চেকসাম শুধু দেখায় যে ডাউনলোড সম্পূর্ণ – কে এটি তৈরি করেছে তা নয়। +E1756 ক্যাটালগের স্বাক্ষর নেই বা অবৈধ – ব্যবহার করা হয়নি diff --git a/tools/i18n/catalog.json b/tools/i18n/catalog.json index 62857460..64e8218c 100644 --- a/tools/i18n/catalog.json +++ b/tools/i18n/catalog.json @@ -1753,7 +1753,11 @@ "from the app repository). Uploaded packages are marked “uploaded – not checked”: the box cannot compare them with the store.", "Signed in", "Over SMB a share of the same name opens instead of this personal folder – create that share again under another name.", - "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address." + "Over SMB this share hides the personal folder of the account of the same name – create it again under another name to free that address.", + "Install from an unsigned source?", + "This app comes from a store source without a valid signature of the ShareOS project.", + "Its checksum only shows that the download is complete – not who made it.", + "catalog signature missing or invalid – not used" ], "patterns": [ [ diff --git a/tools/i18n/de.tsv b/tools/i18n/de.tsv index 0f6fe92d..ce16bbe5 100644 --- a/tools/i18n/de.tsv +++ b/tools/i18n/de.tsv @@ -2177,3 +2177,7 @@ E1749 aus dem App-Repo). Hochgeladene Pakete sind als „hochgeladen – nicht g E1750 Angemeldet E1751 Über SMB öffnet sich statt dieses persönlichen Ordners eine Freigabe gleichen Namens – lege diese Freigabe unter einem anderen Namen neu an. E1752 Über SMB verdeckt diese Freigabe den persönlichen Ordner des gleichnamigen Kontos – lege sie unter einem anderen Namen neu an, um diese Adresse freizugeben. +E1753 Aus einer nicht signierten Quelle installieren? +E1754 Diese App stammt aus einer Store-Quelle ohne gültige Signatur des ShareOS-Projekts. +E1755 Ihre Prüfsumme zeigt nur, dass der Download vollständig ist – nicht, wer sie gemacht hat. +E1756 Katalog-Signatur fehlt oder ist ungültig – nicht verwendet diff --git a/tools/i18n/es.tsv b/tools/i18n/es.tsv index d726a2f8..4a50b9aa 100644 --- a/tools/i18n/es.tsv +++ b/tools/i18n/es.tsv @@ -2193,3 +2193,7 @@ E1749 del repositorio de apps). Los paquetes subidos se marcan como «subida – E1750 Sesión iniciada E1751 Por SMB se abre un recurso compartido con el mismo nombre en lugar de esta carpeta personal: vuelve a crear ese recurso con otro nombre. E1752 Por SMB este recurso compartido oculta la carpeta personal de la cuenta con el mismo nombre: vuelve a crearlo con otro nombre para liberar esa dirección. +E1753 ¿Instalar desde una fuente sin firmar? +E1754 Esta app procede de una fuente de la tienda sin una firma válida del proyecto ShareOS. +E1755 Su suma de comprobación solo muestra que la descarga está completa, no quién la hizo. +E1756 falta la firma del catálogo o no es válida – no se usa diff --git a/tools/i18n/fr.tsv b/tools/i18n/fr.tsv index 5aa0024e..8a243854 100644 --- a/tools/i18n/fr.tsv +++ b/tools/i18n/fr.tsv @@ -2193,3 +2193,7 @@ E1749 depuis le dépôt d'apps). Les paquets téléversés sont marqués « tél E1750 Connecté E1751 En SMB, un partage du même nom s’ouvre à la place de ce dossier personnel – recréez ce partage sous un autre nom. E1752 En SMB, ce partage masque le dossier personnel du compte du même nom – recréez-le sous un autre nom pour libérer cette adresse. +E1753 Installer depuis une source non signée ? +E1754 Cette application provient d’une source du store sans signature valide du projet ShareOS. +E1755 Sa somme de contrôle montre seulement que le téléchargement est complet – pas qui l’a créée. +E1756 signature du catalogue absente ou invalide – non utilisé diff --git a/tools/i18n/hi.tsv b/tools/i18n/hi.tsv index adf021de..ffadf530 100644 --- a/tools/i18n/hi.tsv +++ b/tools/i18n/hi.tsv @@ -2193,3 +2193,7 @@ E1749 से बने)। अपलोड किए पैकेज "अपल E1750 साइन इन E1751 SMB पर इस निजी फ़ोल्डर के बजाय उसी नाम का शेयर खुलता है – उस शेयर को किसी दूसरे नाम से दोबारा बनाएँ। E1752 SMB पर यह शेयर उसी नाम वाले खाते के निजी फ़ोल्डर को छिपा देता है – उस पते को मुक्त करने के लिए इसे किसी दूसरे नाम से दोबारा बनाएँ। +E1753 बिना हस्ताक्षर वाले स्रोत से इंस्टॉल करें? +E1754 यह ऐप ऐसे स्टोर स्रोत से है जिस पर ShareOS प्रोजेक्ट का कोई मान्य हस्ताक्षर नहीं है। +E1755 इसका चेकसम केवल यह दिखाता है कि डाउनलोड पूरा है – यह नहीं कि इसे किसने बनाया। +E1756 कैटलॉग हस्ताक्षर नहीं है या अमान्य है – उपयोग नहीं किया गया diff --git a/tools/i18n/pt.tsv b/tools/i18n/pt.tsv index f7f475e1..0748e926 100644 --- a/tools/i18n/pt.tsv +++ b/tools/i18n/pt.tsv @@ -2193,3 +2193,7 @@ E1749 do repositório de apps). Pacotes enviados são marcados como "enviado – E1750 Conectado E1751 Por SMB abre-se uma partilha com o mesmo nome em vez desta pasta pessoal – crie essa partilha de novo com outro nome. E1752 Por SMB esta partilha oculta a pasta pessoal da conta com o mesmo nome – crie-a de novo com outro nome para libertar esse endereço. +E1753 Instalar a partir de uma fonte não assinada? +E1754 Esta app vem de uma fonte da loja sem uma assinatura válida do projeto ShareOS. +E1755 A sua soma de verificação só mostra que a transferência está completa – não quem a fez. +E1756 assinatura do catálogo em falta ou inválida – não usado diff --git a/tools/i18n/ru.tsv b/tools/i18n/ru.tsv index e00bb2b0..1bdb9cc8 100644 --- a/tools/i18n/ru.tsv +++ b/tools/i18n/ru.tsv @@ -2193,3 +2193,7 @@ E1749 из репозитория приложений). Загруженные E1750 Вход выполнен E1751 По SMB вместо этой личной папки открывается общая папка с тем же именем – создайте эту общую папку заново под другим именем. E1752 По SMB эта общая папка скрывает личную папку учётной записи с тем же именем – создайте её заново под другим именем, чтобы освободить этот адрес. +E1753 Установить из неподписанного источника? +E1754 Это приложение получено из источника магазина без действительной подписи проекта ShareOS. +E1755 Его контрольная сумма показывает лишь, что загрузка завершена, но не то, кто его создал. +E1756 подпись каталога отсутствует или недействительна – не используется diff --git a/tools/i18n/zh.tsv b/tools/i18n/zh.tsv index fb7d3f9d..f890ee7d 100644 --- a/tools/i18n/zh.tsv +++ b/tools/i18n/zh.tsv @@ -2193,3 +2193,7 @@ E1749 构建)。上传的软件包标记为“已上传 – 未校验”:设 E1750 已登录 E1751 通过 SMB 打开的是同名共享,而不是此个人文件夹——请用其他名称重新创建该共享。 E1752 通过 SMB,此共享会遮住同名账户的个人文件夹——请用其他名称重新创建它,以释放该地址。 +E1753 从未签名的来源安装? +E1754 此应用来自没有 ShareOS 项目有效签名的商店来源。 +E1755 其校验和只表明下载完整,并不能说明是谁制作的。 +E1756 目录签名缺失或无效——未使用