bio = BIO_new(BIO_s_mem());
if (!bio)
+ {
+ free(filename);
+ free(fullpath);
+ fclose (fp);
return -1;
+ }
status = PEM_write_bio_X509(bio, context->x509);
status = BIO_read(bio, x509_str, length);
if (status < 0)
+ {
+ free(filename);
+ free(fullpath);
+ fclose (fp);
return -1;
+ }
offset += status;
}
if (status < 0)
+ {
+ if (x509_str)
+ free (x509_str);
+ free(filename);
+ free(fullpath);
+ fclose (fp);
return -1;
+ }
length = offset;
bio = BIO_new(BIO_s_mem());
if (!bio)
+ {
+ free(filename);
+ free(fullpath);
+ fclose (fp);
return -1;
+ }
status = PEM_write_bio_PrivateKey(bio, context->pkey, NULL, NULL, 0, NULL, NULL);
status = BIO_read(bio, x509_str, length);
if (status < 0)
+ {
+ if (x509_str)
+ free(x509_str);
+ free(filename);
+ free(fullpath);
+ fclose (fp);
return -1;
+ }
offset += status;
}
if (status < 0)
+ {
+ if (x509_str)
+ free(x509_str);
+ free(filename);
+ free(fullpath);
+ fclose (fp);
return -1;
+ }
length = offset;