saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.1k stars 5.47k forks source link

[BUG] NACL - Problem with `generate pk using the sk` procedure #66900

Open hatamiarash7 opened 3 days ago

hatamiarash7 commented 3 days ago

Description

As mentioned in documentation, we can generate the pk from sk using this command:

salt-call --local nacl.keygen sk_file=/etc/salt/pki/master/nacl

But, this function will generate a sk like the pk ( sk=pk ) and it's wrong.

Steps to Reproduce the behavior

  1. Create a sk_file using salt-call --local nacl.keygen data.
  2. Try to generate pk_file using salt-call --local nacl.keygen sk_file=/etc/salt/pki/master/nacl command
  3. Check /etc/salt/pki/master/nacl.pub content. It equals /etc/salt/pki/master/nacl.

Expected behavior

The generated pk content should be different and have the correct value.

Screenshots

telegram-cloud-photo-size-4-6003854029559548245-y

Versions Report

salt --versions-report ```yaml Salt Version: Salt: 3006.8 Python Version: Python: 3.10.14 (main, Apr 3 2024, 21:30:09) [GCC 11.2.0] Dependency Versions: cffi: 1.17.1 cherrypy: unknown dateutil: 2.8.1 docker-py: 7.1.0 gitdb: Not Installed gitpython: Not Installed Jinja2: 3.1.3 libgit2: Not Installed looseversion: 1.0.2 M2Crypto: Not Installed Mako: Not Installed msgpack: 1.0.2 msgpack-pure: Not Installed mysql-python: Not Installed packaging: 22.0 pycparser: 2.21 pycrypto: Not Installed pycryptodome: 3.19.1 pygit2: Not Installed python-gnupg: 0.4.8 PyYAML: 6.0.1 PyZMQ: 23.2.0 relenv: 0.16.0 smmap: Not Installed timelib: 0.2.4 Tornado: 4.5.3 ZMQ: 4.3.4 System Versions: dist: ubuntu 22.04.3 jammy locale: utf-8 machine: x86_64 release: 5.15.0-122-generic system: Linux version: Ubuntu 22.04.3 jammy ```
hurzhurz commented 2 days ago

There is also an issue from me about this (and a second similar problem with nacl.keygen): #66772 :) And I also already created a PR to fix both: #66773