[openssl-users] Const qualifier for EVP_PKEY parameters in pub_encode method

Reinier Torenbeek reinier.torenbeek at gmail.com
Wed Oct 28 20:42:45 UTC 2015


Hi,

While implementing an engine, I run into the following prototype that I
need to implement:

struct evp_pkey_asn1_method_st
{
  <snip>
  int (*pub_encode)(X509_PUBKEY *pub, *const* EVP_PKEY *pk);
  <snip>
} /* EVP_PKEY_ASN1_METHOD */;

Inside this function, I want to assign pk to pub->pkey (and do the
necessary up and down reffing of the EVP_PKEYs involved). But that is
not allowed, because of the const qualifier on pk.

For now, I have just worked around the compiler complaints by casting to
a non-const, but I wonder whether this will bite me at some point?

Thanks,
Reinier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20151028/2eb9473d/attachment.html>


More information about the openssl-users mailing list