<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
You shouldn't be accessing the internal of a private structure.
That structure was made private for a reason and duplicating it in
your engine will break when we change the structure's contents.<br>
<br>
Your engine should be using the EVP_PKEY_meth_set_* function to do
what you want (for 1.1.1). For 3.0, you should be writing a
provider instead.<br>
<br>
<br>
Pauli<br>
<br>
<div class="moz-cite-prefix">On 12/4/21 5:04 am, Shariful Alam
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAA0KgGr8u3CVL+4chx2UfNAMBxExa9RrpEr17mVfocQojL4p_g@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Hello,
<div>Hope you guys are doing well. I'm trying to develop an RSA
engine. My engine was somewhat working until I try to
integrate my engine with an apache httpd server. After
installing the httpd from the source code, it turns out that,
I can't compile my engine anymore. I get the following error
while I try to compile (it was compiling before and I did not
make any changes to my engine code).</div>
<div><br>
</div>
<div>==============================</div>
<div><br>
</div>
<div><b>$gcc -fPIC -c r_engine.c</b></div>
<div><b>r_engine.c:29:8: error: redefinition of ‘struct
rsa_meth_st’<br>
struct rsa_meth_st {<br>
^<br>
In file included from /usr/include/openssl/crypto.h:131:0,<br>
from r_engine.c:7:<br>
/usr/include/openssl/ossl_typ.h:147:16: note: originally
defined here<br>
typedef struct rsa_meth_st RSA_METHOD;</b><br>
</div>
<div><br>
</div>
<div>=============================</div>
<div><br>
</div>
<div>and my <b>struct rsa_meth_st </b>looks like the
following,</div>
<div><br>
</div>
<div>================================================================================</div>
<div><br>
</div>
<div><b>struct rsa_meth_st {<br>
<br>
const char *name;<br>
int (*rsa_pub_enc) (int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding);<br>
int (*rsa_pub_dec) (int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding);<br>
int (*rsa_priv_enc) (int flen, const unsigned char
*from, unsigned char *to, RSA *rsa, int padding);<br>
int (*rsa_priv_dec) (int flen, const unsigned char
*from, unsigned char *to, RSA *rsa, int padding);<br>
<br>
int (*rsa_mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA
*rsa, BN_CTX *ctx);<br>
<br>
int (*bn_mod_exp) (BIGNUM *r, const BIGNUM *a, const
BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX
*m_ctx);<br>
<br>
int (*init) (RSA *rsa);<br>
<br>
int (*finish) (RSA *rsa);<br>
<br>
int flags;<br>
<br>
char *app_data;<br>
<br>
int (*rsa_sign) (int type, const unsigned char *m,
unsigned int m_length, unsigned char *sigret, unsigned int
*siglen, const RSA *rsa);<br>
<br>
int (*rsa_verify) (int dtype, const unsigned char *m,
unsigned int m_length, const unsigned char *sigbuf, unsigned
int siglen, const RSA *rsa);<br>
<br>
int (*rsa_keygen) (RSA *rsa, int bits, BIGNUM *e,
BN_GENCB *cb);<br>
<br>
};<br>
</b></div>
<div><br>
</div>
<div>=================================================================================</div>
<div><br>
</div>
<div>My sample skeleton code is here <a
href="https://pastebin.com/uNXYknEA" moz-do-not-send="true">https://pastebin.com/uNXYknEA</a></div>
<div><br>
</div>
<div>Can anyone please tell me what I'm I doing wrong?</div>
<div><br>
</div>
<div>Regards,</div>
<div>Shariful Alam</div>
</div>
</blockquote>
<br>
</body>
</html>