Const qualifier for EVP_PKEY parameters in pub_encode method

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Const qualifier for EVP_PKEY parameters in pub_encode method

Reinier Torenbeek
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

_______________________________________________
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users