Topic: About cryptocb for Certificate Signing request(CSR) generation

Hi~

I wanted to use my secure element to sign the CSR and referenced the wolfssl-examples csr_cryptocb.c. I used the wc_SignCert_ex function into my callback function. I got the wrong fomat CSR:

-----BEGIN CERTIFICATE REQUEST-----
MIIDBzCB8wIBAjCBkDELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk9SMREwDwYDVQQH
DAhQb3J0bGFuZDEQMA4GA1UECgwHd29sZlNTTDEUMBIGA1UECwwLRGV2ZWxvcG1l
bnQxGDAWBgNVBAMMD3d3dy53b2xmc3NsLmNvbTEfMB0GCSqGSIb3DQEJARYQaW5m
b0B3b2xmc3NsLmNvbTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABD6I4gQ7axFX
tIOtulG0VaAeg0nMy72Etqz4JyWakqIKAGuvjIDPw3I+NHmKvzwOjkQ/taeuhIpr
yoFn1J1LtzugADAKBggqhkjOPQQDAgOCAgEAFNv7PxTb+z8AAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
MIGQMQswCQYDVQQGEwJVUzELMAkGA1UECAwCT1IxETAPBgNVBAcMCFBvcnRsYW5k
MRAwDgYDVQQKDAd3b2xmU1NMMRQwEgYDVQQLDAtEZXZlbG9wbWVudDEYMBYGA1UE
AwwPd3d3LndvbGZzc2wuY29tMR8wHQYJKoZIhvcNAQkBFhBpbmZvQHdvbGZzc2wu
Y29tAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAHAD/D8=
-----END CERTIFICATE REQUEST-----

I found the info->pk.eccsign.outlen always return 512, maybe it's a problem.
Is there something I've missed? thanks

Share

Re: About cryptocb for Certificate Signing request(CSR) generation

Hi Pokemon,

Thanks for joining the wolfSSL Forums. Perhaps it would be helpful to review some SE implementations. Here is a good reference:
https://github.com/wolfSSL/wolfssl/tree … ort/silabs
https://github.com/wolfSSL/wolfssl/blob … labs_ecc.c

What platform is your SE using?

Thanks,
Eric @ wolfSSL Support

Re: About cryptocb for Certificate Signing request(CSR) generation

Dear Eric
I'm learning atecc608, I have resolved my problem. After singing the CSR, execute wc_ecc_rs_raw_to_sig that transform the signature to der format.

Thanks.

Share

Re: About cryptocb for Certificate Signing request(CSR) generation

Oh, that's great! I think you'll find our repository of ATECC demos very useful:
https://github.com/wolfSSL/microchip-atecc-demos