mirror of https://github.com/keeweb/keeweb.git
check plugins public keys
This commit is contained in:
parent
fae40c8c3e
commit
af2de71e5d
|
@ -465,7 +465,7 @@
|
|||
"setPlJs": "code",
|
||||
"setPlCss": "styles",
|
||||
"setPlLoc": "language",
|
||||
"setPlCreatedBy": "created by {}",
|
||||
"setPlCreatedBy": "Created by {}",
|
||||
"setPlLoadTime": "took {} to load",
|
||||
"setPlLastUpdate": "Last check for updates",
|
||||
"setPlLoadError": "error loading plugin",
|
||||
|
|
|
@ -5,6 +5,8 @@ const kdbxweb = require('kdbxweb');
|
|||
const SignatureVerifier = {
|
||||
logger: new Logger('signature-verifier'),
|
||||
|
||||
publicKey: null,
|
||||
|
||||
verify(data, signature, pk) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const algo = {name: 'RSASSA-PKCS1-v1_5', hash: {name: 'SHA-256'}};
|
||||
|
@ -70,9 +72,12 @@ const SignatureVerifier = {
|
|||
},
|
||||
|
||||
getPublicKey() {
|
||||
return publicKey
|
||||
.match(/-+BEGIN PUBLIC KEY-+([\s\S]+?)-+END PUBLIC KEY-+/)[1]
|
||||
.replace(/\s+/g, '');
|
||||
if (!this.publicKey) {
|
||||
this.publicKey = publicKey
|
||||
.match(/-+BEGIN PUBLIC KEY-+([\s\S]+?)-+END PUBLIC KEY-+/)[1]
|
||||
.replace(/\s+/g, '');
|
||||
}
|
||||
return this.publicKey;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ const AppSettingsModel = require('../../models/app-settings-model');
|
|||
const Comparators = require('../../util/comparators');
|
||||
const Format = require('../../util/format');
|
||||
const SettingsManager = require('../../comp/settings-manager');
|
||||
const SignatureVerifier = require('../../util/signature-verifier');
|
||||
|
||||
const SettingsPluginsView = Backbone.View.extend({
|
||||
template: require('templates/settings/settings-plugins.hbs'),
|
||||
|
@ -47,7 +48,8 @@ const SettingsPluginsView = Backbone.View.extend({
|
|||
galleryLoading: PluginGallery.loading,
|
||||
galleryLoadError: PluginGallery.loadError,
|
||||
galleryPlugins: this.getGalleryPlugins(),
|
||||
searchStr: this.searchStr
|
||||
searchStr: this.searchStr,
|
||||
publicKey: SignatureVerifier.getPublicKey()
|
||||
});
|
||||
if (this.searchStr) {
|
||||
this.showFilterResults();
|
||||
|
|
|
@ -15,8 +15,12 @@
|
|||
</ul>
|
||||
</div>
|
||||
<div class="settings__plugins-plugin-desc">
|
||||
<a href="{{plugin.manifest.url}}" target="_blank">{{plugin.manifest.url}}</a>, v{{plugin.manifest.version}},
|
||||
{{#res 'setPlCreatedBy'}}<a href="{{plugin.manifest.author.url}}" target="_blank">{{plugin.manifest.author.name}}</a> ({{plugin.manifest.author.email}}){{/res}},
|
||||
<a href="{{plugin.manifest.url}}" target="_blank">{{plugin.manifest.url}}</a>, v{{plugin.manifest.version}}.
|
||||
{{#ifeq plugin.manifest.publicKey ../publicKey}}
|
||||
{{res 'setPlOfficial'}},
|
||||
{{else}}
|
||||
{{#res 'setPlCreatedBy'}}<a href="{{plugin.manifest.author.url}}" target="_blank">{{plugin.manifest.author.name}}</a> ({{plugin.manifest.author.email}}){{/res}},
|
||||
{{/ifeq}}
|
||||
{{#ifeq plugin.status 'active'}}
|
||||
{{#res 'setPlLoadTime'}}{{plugin.installTime}}ms{{/res}}
|
||||
{{else}}
|
||||
|
@ -69,11 +73,11 @@
|
|||
{{#if plugin.manifest.resources.loc}}<li class="settings__plugins-plugin-file"><i class="fa fa-language"></i> {{res 'setPlLoc'}}: {{plugin.manifest.locale.title}}</li>{{/if}}
|
||||
</ul>
|
||||
<div class="settings__plugins-gallery-plugin-author muted-color">
|
||||
{{#if plugin.official}}
|
||||
{{#ifeq plugin.manifest.publicKey ../publicKey}}
|
||||
<i class="fa fa-check"></i> {{res 'setPlOfficial'}}
|
||||
{{else}}
|
||||
<i class="fa fa-at"></i> <a href="{{plugin.manifest.author.url}}" target="_blank">{{plugin.manifest.author.name}}</a> ({{plugin.manifest.author.email}})
|
||||
{{/if}}
|
||||
{{/ifeq}}
|
||||
</div>
|
||||
<button class="settings__plugins-gallery-plugin-install-btn"
|
||||
data-plugin="{{plugin.manifest.name}}"
|
||||
|
|
Loading…
Reference in New Issue