[openssl-users] RSA_method_set_sign

Melvyn Sopacua m.r.sopacua at gmail.com
Mon Feb 27 17:36:21 UTC 2017

On Saturday 25 February 2017 12:22:09 Dr. Stephen Henson wrote:
> You can set the values in place using something like this:
> unsigned char *tmps = NULL;
> int tmpslen;
> X509_SIG *sig = X509_SIG_new();
> X509_ALGOR *alg;
> ASN1_OCTET_STRING *digest;
> X509_SIG_getm(sig, &alg, &digest);
> X509_ALGOR_set0(alg, OBJ_nid2obj(type), V_ASN1_NULL, NULL);
> ASN1_STRING_set(digest, m, m_len);
> /* Allocate and encode */
> tmpslen = i2d_X509_SIG(&sig, &tmps);
> X509_SIG_free(sig);

Thanks. Totally clear now. But, I have to say, this method is badly named. It walks and 
talks like a set0() but is called getm(). This is why I assumed, the pointers may have 
been filled by X509_SIG_new() and I'd be responsible for them.

Melvyn Sopacua
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20170227/b61f9504/attachment.html>

More information about the openssl-users mailing list