228 EPNAME(
"X509Req::GetExtension");
233 DEBUG(
"OID string not defined");
239 DEBUG(
"certificate is not initialized");
244 STACK_OF(X509_EXTENSION) *esk = X509_REQ_get_extensions(creq);
246#if OPENSSL_VERSION_NUMBER >= 0x10000000L
247 int numext = sk_X509_EXTENSION_num(esk);
249 int numext = sk_num(esk);
252 DEBUG(
"certificate has got no extensions");
255 DEBUG(
"certificate request has "<<numext<<
" extensions");
259 int nid = OBJ_sn2nid(oid);
260 bool usenid = (nid > 0);
264 X509_EXTENSION *wext = 0;
265 for (i = 0; i< numext; i++) {
266#if OPENSSL_VERSION_NUMBER >= 0x10000000L
267 wext = sk_X509_EXTENSION_value(esk, i);
269 wext = (X509_EXTENSION *)sk_value(esk, i);
272 int enid = OBJ_obj2nid(X509_EXTENSION_get_object(wext));
278 OBJ_obj2txt(s,
sizeof(s), X509_EXTENSION_get_object(wext), 1);
287 DEBUG(
"Extension "<<oid<<
" not found");