From dda5413ae2e7a1fca416bab9694bdef930479cad Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 21 Nov 2013 10:48:45 -0800 Subject: [PATCH] moved some #defines around to fix sessioncerts-only build --- src/ssl.c | 84 +++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index 43f0579c0..afbc15b74 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -7092,6 +7092,21 @@ int CyaSSL_set_compression(CYASSL* ssl) } + int CyaSSL_X509_get_isCA(CYASSL_X509* x509) + { + int isCA = 0; + + CYASSL_ENTER("CyaSSL_X509_get_isCA"); + + if (x509 != NULL) + isCA = x509->isCa; + + CYASSL_LEAVE("CyaSSL_X509_get_isCA", isCA); + + return isCA; + } + + #ifdef OPENSSL_EXTRA int CyaSSL_X509_ext_isSet_by_NID(CYASSL_X509* x509, int nid) { @@ -7141,25 +7156,8 @@ int CyaSSL_set_compression(CYASSL* ssl) return crit; } -#endif - int CyaSSL_X509_get_isCA(CYASSL_X509* x509) - { - int isCA = 0; - - CYASSL_ENTER("CyaSSL_X509_get_isCA"); - - if (x509 != NULL) - isCA = x509->isCa; - - CYASSL_LEAVE("CyaSSL_X509_get_isCA", isCA); - - return isCA; - } - - -#ifdef OPENSSL_EXTRA int CyaSSL_X509_get_isSet_pathLength(CYASSL_X509* x509) { int isSet = 0; @@ -7259,32 +7257,6 @@ int CyaSSL_set_compression(CYASSL* ssl) return id; } -#endif - - - /* copy name into in buffer, at most sz bytes, if buffer is null will - malloc buffer, call responsible for freeing */ - char* CyaSSL_X509_NAME_oneline(CYASSL_X509_NAME* name, char* in, int sz) - { - int copySz = min(sz, name->sz); - - CYASSL_ENTER("CyaSSL_X509_NAME_oneline"); - if (!name->sz) return in; - - if (!in) { - in = (char*)XMALLOC(name->sz, 0, DYNAMIC_TYPE_OPENSSL); - if (!in ) return in; - copySz = name->sz; - } - - if (copySz == 0) - return in; - - XMEMCPY(in, name->name, copySz - 1); - in[copySz - 1] = 0; - - return in; - } int CyaSSL_X509_NAME_entry_count(CYASSL_X509_NAME* name) @@ -7355,6 +7327,32 @@ int CyaSSL_set_compression(CYASSL* ssl) CYASSL_LEAVE("CyaSSL_X509_NAME_get_text_by_NID", textSz); return textSz; } +#endif + + + /* copy name into in buffer, at most sz bytes, if buffer is null will + malloc buffer, call responsible for freeing */ + char* CyaSSL_X509_NAME_oneline(CYASSL_X509_NAME* name, char* in, int sz) + { + int copySz = min(sz, name->sz); + + CYASSL_ENTER("CyaSSL_X509_NAME_oneline"); + if (!name->sz) return in; + + if (!in) { + in = (char*)XMALLOC(name->sz, 0, DYNAMIC_TYPE_OPENSSL); + if (!in ) return in; + copySz = name->sz; + } + + if (copySz == 0) + return in; + + XMEMCPY(in, name->name, copySz - 1); + in[copySz - 1] = 0; + + return in; + } int CyaSSL_X509_get_signature_type(CYASSL_X509* x509)