Skip to content
Snippets Groups Projects
Commit d6a30c5f authored by Millicent Billette's avatar Millicent Billette
Browse files

v3.3.1

FIX: remove ambiguous isPubkey ( a deprecated version of isPubKey )
parent 1ed2fe58
No related branches found
No related tags found
No related merge requests found
Pipeline #17348 failed
...@@ -15,6 +15,10 @@ et ce projet adhère au [versionnage sémantique](https://semver.org/spec/v2.0.0 ...@@ -15,6 +15,10 @@ et ce projet adhère au [versionnage sémantique](https://semver.org/spec/v2.0.0
## [Non-publié/Non-Stabilisé] (par [1000i100]) ## [Non-publié/Non-Stabilisé] (par [1000i100])
## [Version 3.3.1] - 2022-09-30 (par [1000i100])
### Corrections
- suppression de crypto.isPubkey(pubkey) qui ne validait qu'à partir d'une regex contrairement à crypto.isPubKey(pubKey) qui effectue les vérifications implémentées dans la v3.3.0
## [Version 3.3.0] - 2022-09-30 (par [1000i100]) ## [Version 3.3.0] - 2022-09-30 (par [1000i100])
### Ajouté ### Ajouté
- crypto.isPubKey(pubKey) identique à checkKey mais retourne vrai ou faux là où checkKey throw une erreur en cas d'échec de validation. - crypto.isPubKey(pubKey) identique à checkKey mais retourne vrai ou faux là où checkKey throw une erreur en cas d'échec de validation.
...@@ -86,8 +90,9 @@ et ce projet adhère au [versionnage sémantique](https://semver.org/spec/v2.0.0 ...@@ -86,8 +90,9 @@ et ce projet adhère au [versionnage sémantique](https://semver.org/spec/v2.0.0
- intégration des librairies de crypto nécessaires - intégration des librairies de crypto nécessaires
- calcul de la clef publique correspondant à chaque combinaison de secrets saisie, et comparaison à la clef publique de référence. - calcul de la clef publique correspondant à chaque combinaison de secrets saisie, et comparaison à la clef publique de référence.
[Non-publié/Non-Stabilisé]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.3.0...master [Non-publié/Non-Stabilisé]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.3.1...master
[Version 3.3.1]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.3.0...v3.3.1
[Version 3.3.0]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.2.0...v3.3.0 [Version 3.3.0]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.2.0...v3.3.0
[Version 3.2.0]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.1.0...v3.2.0 [Version 3.2.0]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.1.0...v3.2.0
[Version 3.1.0]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.0.3...v3.1.0 [Version 3.1.0]: https://git.duniter.org/libs/g1lib.js/-/compare/v3.0.3...v3.1.0
......
{ {
"name": "g1lib", "name": "g1lib",
"version": "3.3.0", "version": "3.3.1",
"description": "An ubiquitous static javascript toolbox lib for Ǧ1 / Duniter ecosystem with reliability in mind.", "description": "An ubiquitous static javascript toolbox lib for Ǧ1 / Duniter ecosystem with reliability in mind.",
"main": "nodejs/all.mjs", "main": "nodejs/all.mjs",
"browser": "browser/all.mjs", "browser": "browser/all.mjs",
......
...@@ -13,8 +13,6 @@ const sha256 = sha(); ...@@ -13,8 +13,6 @@ const sha256 = sha();
const generateKeypair = nacl.sign.keyPair.fromSeed; const generateKeypair = nacl.sign.keyPair.fromSeed;
export const isPubkey = (value) => /^[A-HJ-NP-Za-km-z1-9]{42,45}$/.test(value)
export async function idSecPass2rawAll(idSec, pass) { export async function idSecPass2rawAll(idSec, pass) {
const rawSeed = await saltPass2seed(idSec, pass); const rawSeed = await saltPass2seed(idSec, pass);
const keyPair = seed2keyPair(rawSeed); const keyPair = seed2keyPair(rawSeed);
......
...@@ -30,7 +30,6 @@ test('array sign string', async t => t.is((await app.sign(unsignedDocument, secr ...@@ -30,7 +30,6 @@ test('array sign string', async t => t.is((await app.sign(unsignedDocument, secr
test('uint8array sign string', async t => t.is((await app.sign(unsignedDocument, secretKey, 'uint8array'))[0], 27)); test('uint8array sign string', async t => t.is((await app.sign(unsignedDocument, secretKey, 'uint8array'))[0], 27));
test('sign throw for bad output format', async t => t.throwsAsync(() => app.sign(unsignedDocument, secretKey, 'whattt ?'))); test('sign throw for bad output format', async t => t.throwsAsync(() => app.sign(unsignedDocument, secretKey, 'whattt ?')));
test("is a pubkey", (t) => t.is(app.isPubkey(pubKey), true));
test('b58 should decode/encode well', t => t.is(app.b58.encode(app.b58.decode(pubKey)), pubKey)); test('b58 should decode/encode well', t => t.is(app.b58.encode(app.b58.decode(pubKey)), pubKey));
test('b58 on pubKey with leading 1', t => t.is(app.b58.encode(app.b58.decode('12BjyvjoAf5qik7R8TKDJAHJugsX23YgJGi2LmBUv2nx')), '12BjyvjoAf5qik7R8TKDJAHJugsX23YgJGi2LmBUv2nx')); test('b58 on pubKey with leading 1', t => t.is(app.b58.encode(app.b58.decode('12BjyvjoAf5qik7R8TKDJAHJugsX23YgJGi2LmBUv2nx')), '12BjyvjoAf5qik7R8TKDJAHJugsX23YgJGi2LmBUv2nx'));
test('b58 on pubKey without leading 1', t => t.is(app.b58.encode(app.b58.decode('2BjyvjoAf5qik7R8TKDJAHJugsX23YgJGi2LmBUv2nx')), '2BjyvjoAf5qik7R8TKDJAHJugsX23YgJGi2LmBUv2nx')); test('b58 on pubKey without leading 1', t => t.is(app.b58.encode(app.b58.decode('2BjyvjoAf5qik7R8TKDJAHJugsX23YgJGi2LmBUv2nx')), '2BjyvjoAf5qik7R8TKDJAHJugsX23YgJGi2LmBUv2nx'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment