Merge branch 'master' of github.com:cyassl/cyassl

This commit is contained in:
toddouska 2013-04-11 15:00:42 -07:00
commit 8a6bd081c4
2 changed files with 12 additions and 2 deletions

View File

@ -2800,10 +2800,19 @@ int DerToPem(const byte* der, word32 derSz, byte* output, word32 outSz,
if (type == CERT_TYPE) {
XSTRNCPY(header, "-----BEGIN CERTIFICATE-----\n", sizeof(header));
XSTRNCPY(footer, "-----END CERTIFICATE-----\n", sizeof(footer));
} else {
}
else if (type == PRIVATEKEY_TYPE) {
XSTRNCPY(header, "-----BEGIN RSA PRIVATE KEY-----\n", sizeof(header));
XSTRNCPY(footer, "-----END RSA PRIVATE KEY-----\n", sizeof(footer));
}
#ifdef HAVE_ECC
else if (type == ECC_PRIVATEKEY_TYPE) {
XSTRNCPY(header, "-----BEGIN EC PRIVATE KEY-----\n", sizeof(header));
XSTRNCPY(footer, "-----END EC PRIVATE KEY-----\n", sizeof(footer));
}
#endif
else
return BAD_FUNC_ARG;
headerLen = (int)XSTRLEN(header);
footerLen = (int)XSTRLEN(footer);

View File

@ -40,7 +40,8 @@ enum CertType {
PRIVATEKEY_TYPE,
DH_PARAM_TYPE,
CRL_TYPE,
CA_TYPE
CA_TYPE,
ECC_PRIVATEKEY_TYPE
};