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

CFSSL AUTHENTICATED SIGNER #3120

Open
tendaworld opened this issue Jun 4, 2024 · 0 comments
Open

CFSSL AUTHENTICATED SIGNER #3120

tendaworld opened this issue Jun 4, 2024 · 0 comments
Labels
feature-request New feature request

Comments

@tendaworld
Copy link

tendaworld commented Jun 4, 2024

Hi Vitor,

Currently the cfssl CA only uses the /sign endpoint.

This can be improved to also support the /authsign endpoint and enhance its overall security.

var crypto = require('crypto');
var fs = require("fs")

const auth_key_as_hex = "0123456789ABCDEF0123456789ABCDEF"
const key_usable_for_crypto_hmac = new Buffer.from(auth_key_as_hex,"hex")
const cfssl_csr_as_buffer = fs.readFileSync("./csr.json","utf-8")

var hash = crypto.createHmac('sha256', key_usable_for_crypto_hmac)
hash.update(cfssl_csr_as_buffer);

label = ecc
profile = client
certificate_request = {"certificate_request": cfssl_csr_as_buffer, "label": label, "profile": profile}

var cfssl_auth_request_format = {
    "token":hash.digest("base64"),
    "request":Buffer.from(certificate_request).toString("base64")
}
console.log(JSON.stringify(cfssl_auth_request_format,null,4))

........something like this should be able to work.

@tendaworld tendaworld added the feature-request New feature request label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature request
Projects
None yet
Development

No branches or pull requests

1 participant