90 unsigned char *salt,
int saltlen,
91 unsigned char *aiv,
int prf_nid)
93 X509_ALGOR *scheme = NULL, *kalg = NULL, *ret = NULL;
108 if(!(pbe2 = PBE2PARAM_new()))
goto merr;
114 if(!(scheme->
parameter = ASN1_TYPE_new()))
goto merr;
139 if ((prf_nid == -1) &&
156 X509_ALGOR_free(pbe2->
keyfunc);
165 if(!(ret = X509_ALGOR_new()))
goto merr;
166 if(!(ret->parameter = ASN1_TYPE_new()))
goto merr;
173 &ret->parameter->value.sequence))
goto merr;
176 PBE2PARAM_free(pbe2);
185 PBE2PARAM_free(pbe2);
187 X509_ALGOR_free(kalg);
188 X509_ALGOR_free(ret);
195 unsigned char *salt,
int saltlen)
201 int prf_nid,
int keylen)
207 if(!(kdf = PBKDF2PARAM_new()))
223 memcpy (osalt->
data, salt, saltlen);
246 kdf->
prf = X509_ALGOR_new();
255 keyfunc = X509_ALGOR_new();
263 if(!(keyfunc->
parameter = ASN1_TYPE_new()))
271 PBKDF2PARAM_free(kdf);
276 PBKDF2PARAM_free(kdf);
277 X509_ALGOR_free(keyfunc);