Commit af9e3d65 authored by Tom Lane's avatar Tom Lane

Minor code beautification in contrib/sslinfo.

Static-ify some functions that didn't need to be exported, and improve
a couple of comments.

Gurjeet Singh
parent e6170126
...@@ -31,9 +31,10 @@ Datum ssl_client_dn_field(PG_FUNCTION_ARGS); ...@@ -31,9 +31,10 @@ Datum ssl_client_dn_field(PG_FUNCTION_ARGS);
Datum ssl_issuer_field(PG_FUNCTION_ARGS); Datum ssl_issuer_field(PG_FUNCTION_ARGS);
Datum ssl_client_dn(PG_FUNCTION_ARGS); Datum ssl_client_dn(PG_FUNCTION_ARGS);
Datum ssl_issuer_dn(PG_FUNCTION_ARGS); Datum ssl_issuer_dn(PG_FUNCTION_ARGS);
Datum X509_NAME_field_to_text(X509_NAME *name, text *fieldName);
Datum X509_NAME_to_text(X509_NAME *name); static Datum X509_NAME_field_to_text(X509_NAME *name, text *fieldName);
Datum ASN1_STRING_to_text(ASN1_STRING *str); static Datum X509_NAME_to_text(X509_NAME *name);
static Datum ASN1_STRING_to_text(ASN1_STRING *str);
/* /*
...@@ -51,7 +52,7 @@ ssl_is_used(PG_FUNCTION_ARGS) ...@@ -51,7 +52,7 @@ ssl_is_used(PG_FUNCTION_ARGS)
/* /*
* Returns SSL cipher currently in use. * Returns SSL version currently in use.
*/ */
PG_FUNCTION_INFO_V1(ssl_version); PG_FUNCTION_INFO_V1(ssl_version);
Datum Datum
...@@ -77,7 +78,7 @@ ssl_cipher(PG_FUNCTION_ARGS) ...@@ -77,7 +78,7 @@ ssl_cipher(PG_FUNCTION_ARGS)
/* /*
* Indicates whether current client have provided a certificate * Indicates whether current client provided a certificate
* *
* Function has no arguments. Returns bool. True if current session * Function has no arguments. Returns bool. True if current session
* is SSL session and client certificate is verified, otherwise false. * is SSL session and client certificate is verified, otherwise false.
...@@ -138,7 +139,7 @@ ssl_client_serial(PG_FUNCTION_ARGS) ...@@ -138,7 +139,7 @@ ssl_client_serial(PG_FUNCTION_ARGS)
* Returns Datum, which can be directly returned from a C language SQL * Returns Datum, which can be directly returned from a C language SQL
* function. * function.
*/ */
Datum static Datum
ASN1_STRING_to_text(ASN1_STRING *str) ASN1_STRING_to_text(ASN1_STRING *str)
{ {
BIO *membuf; BIO *membuf;
...@@ -182,7 +183,7 @@ ASN1_STRING_to_text(ASN1_STRING *str) ...@@ -182,7 +183,7 @@ ASN1_STRING_to_text(ASN1_STRING *str)
* Returns result of ASN1_STRING_to_text applied to appropriate * Returns result of ASN1_STRING_to_text applied to appropriate
* part of name * part of name
*/ */
Datum static Datum
X509_NAME_field_to_text(X509_NAME *name, text *fieldName) X509_NAME_field_to_text(X509_NAME *name, text *fieldName)
{ {
char *string_fieldname; char *string_fieldname;
...@@ -287,7 +288,7 @@ ssl_issuer_field(PG_FUNCTION_ARGS) ...@@ -287,7 +288,7 @@ ssl_issuer_field(PG_FUNCTION_ARGS)
* Returns: text datum which contains string representation of * Returns: text datum which contains string representation of
* X509_NAME * X509_NAME
*/ */
Datum static Datum
X509_NAME_to_text(X509_NAME *name) X509_NAME_to_text(X509_NAME *name)
{ {
BIO *membuf = BIO_new(BIO_s_mem()); BIO *membuf = BIO_new(BIO_s_mem());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment