[gnutls-help] How to encode/decode ECDSA signatures to raw format

Nicolas Mora nicolas at babelouest.org
Wed May 24 18:27:36 CEST 2017


Hello,

I'm still working on porting libjwt 
https://github.com/benmcollins/libjwt from openssl to gnutls.

The last problem I have is about ECDSA signatures. If I use a 
GNUTLS_PK_EC private key to sign the data with gnutls_privkey_sign_data, 
the libjwt unit tests fail.

I see in the openssl version of libjwt that after signing the data, that 
it converts to a raw format of R/S, by decoding the signature:
https://github.com/benmcollins/libjwt/blob/master/libjwt/jwt-openssl.c#L264

For the verification procedure, it converts back the signature to ASN1:
https://github.com/benmcollins/libjwt/blob/master/libjwt/jwt-openssl.c#L386

Are there equivalent functions to encode/decode ECDSA signatures in GnuTLS?

Thanks in advance



More information about the Gnutls-help mailing list