Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pg_ed25519: init at 0.2 #89478

Merged
merged 1 commit into from Jun 16, 2020
Merged

pg_ed25519: init at 0.2 #89478

merged 1 commit into from Jun 16, 2020

Conversation

k0001
Copy link
Contributor

@k0001 k0001 commented Jun 4, 2020

Motivation for this change

Add PostgreSQL extension for signing and verifying ed25519 signatures.

Things done

The extension is packaged in the same way other PostgreSQL extensions are packaged.

I tested that everything works as expected with the following vectors (all queries result in true):

CREATE EXTENSION "pg_ed25519";

-- GOOD SIGNATURE
SELECT ed25519.verify
  ( '\x4284abc51bb67235' :: bytea
  , '\xd6addec5afb0528ac17bb178d3e7f2887f9adbb1ad16e110545ef3bc57f9de2314a5c8388f723b8907be0f3ac90c6259bbe885ecc17645df3db7d488f805fa08' :: bytea
  , '\xf81fb54a825fced95eb033afcd64314075abfb0abd20a970892503436f34b863' :: bytea
  ) = true;

-- BAD SIGNATURE: BAD MESSAGE
SELECT ed25519.verify
  ( '\x0000000000000000' :: bytea
  , '\xd6addec5afb0528ac17bb178d3e7f2887f9adbb1ad16e110545ef3bc57f9de2314a5c8388f723b8907be0f3ac90c6259bbe885ecc17645df3db7d488f805fa08' :: bytea
  , '\xf81fb54a825fced95eb033afcd64314075abfb0abd20a970892503436f34b863' :: bytea
  ) = false;

-- BAD SIGNATURE
SELECT ed25519.verify
  ( '\x4284abc51bb67235' :: bytea
  , '\x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' :: bytea
  , '\xf81fb54a825fced95eb033afcd64314075abfb0abd20a970892503436f34b863' :: bytea
  ) = false;

-- BAD SIGNATURE: BAD PUBLIC KEY
SELECT ed25519.verify
  ( '\x4284abc51bb67235' :: bytea
  , '\xd6addec5afb0528ac17bb178d3e7f2887f9adbb1ad16e110545ef3bc57f9de2314a5c8388f723b8907be0f3ac90c6259bbe885ecc17645df3db7d488f805fa08' :: bytea
  , '\x0000000000000000000000000000000000000000000000000000000000000000' :: bytea
  ) = false;

-- EXPECTED SIGNATURE
SELECT ed25519.sign
  ( '\x4284abc51bb67235' :: bytea
  , '\xf81fb54a825fced95eb033afcd64314075abfb0abd20a970892503436f34b863' :: bytea
  , '\x3b26516fb3dc88eb181b9ed73f0bcd52bcd6b4c788e4bcaf46057fd078bee073' :: bytea
  ) = '\xd6addec5afb0528ac17bb178d3e7f2887f9adbb1ad16e110545ef3bc57f9de2314a5c8388f723b8907be0f3ac90c6259bbe885ecc17645df3db7d488f805fa08' :: bytea;
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

PostgreSQL extension for signing and verifying ed25519 signatures.
@thoughtpolice thoughtpolice merged commit b4e428e into NixOS:master Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants