-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 authsign - "json: cannot unmarshal object into Go value of type []uint8" #854
Comments
+1 |
token != auth_key |
To generate the token in bash: cat request.json | openssl dgst -sha256 -mac HMAC -macopt hexkey:$auth_key -binary | base64 |
Thanks @akamac but doesn't works. I have done the following:
sign-request.json
Try:
|
@YpNo My bad, I edited the comment. Actually, you should feed the |
Hi @akamac, Yes Got it !
And Try: Thanks @akamac Regards. |
couple more python examples from python-cfssl issues LasLabs/python-cfssl#26
my own python3 version using the codecs library (tested on python3.8):
Screenshot: |
i have found this as well which covers multiple languages https://github.com/danharper/hmac-examples this is my nodejs version as well which i think is a fairly simple implementation
|
I'm trying to use the authsign endpoint with the standard authenticator and I get the following error:
curl -X POST -d '{ "token": "0123456789ABCDEF0123456789ABCDEF", "request":{"certificate_request": "-----BEGIN CERTIFICATE REQUEST-----\nMIIBUjCB+QIBADBqMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLZXhhbXBsZS5jb20x\nFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xEzARBgNVBAgTCkNhbGlmb3JuaWExGDAW\nBgNVBAMTD3d3dy5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IA\nBK/CtZaQ4VliKE+DLIVGLwtSxJgtUKRzGvN1EwI3HRgKDQ3l3urBIzHtUcdMq6HZ\nb8jX0O9fXYUOf4XWggrLk1agLTArBgkqhkiG9w0BCQ4xHjAcMBoGA1UdEQQTMBGC\nD3d3dy5leGFtcGxlLmNvbTAKBggqhkjOPQQDAgNIADBFAiAcvfhXnsLtzep2sKSa\n36W7G9PRbHh8zVGlw3Hph8jR1QIhAKfrgplKwXcUctU5grjQ8KXkJV8RxQUo5KKs\ngFnXYtkb\n-----END CERTIFICATE REQUEST-----"}}' http://localhost:8888/api/v1/cfssl/authsign | python -m json.tool
{
"errors": [
{
"code": 400,
"message": "json: cannot unmarshal object into Go value of type []uint8"
}
],
"messages": [],
"result": null,
"success": false
}
My cfssl config file:
{
"signing": {
"profiles": {
"CA": {
"usages": ["cert sign"],
"expiry": "720h",
"auth_key": "ca-auth"
},
"email": {
"usages": ["s/mime"],
"expiry": "720h"
}
},
"default": {
"usages": ["signing", "key encipherment", "server auth", "client auth"],
"expiry": "8760h",
"auth_key": "ca-auth"
}
},
"auth_keys": {
"ca-auth": {
"type":"standard",
"key":"0123456789ABCDEF0123456789ABCDEF"
}
},
"remotes": {
"localhost": "0.0.0.0:8888"
}
}
The text was updated successfully, but these errors were encountered: