Constify code about X509_VERIFY_PARAM
authorFdaSilvaYY <fdasilvayy@gmail.com>
Thu, 15 Sep 2016 19:37:14 +0000 (21:37 +0200)
committerRich Salz <rsalz@openssl.org>
Sun, 18 Sep 2016 04:22:00 +0000 (00:22 -0400)
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1594)

crypto/x509/x509_vpm.c
doc/crypto/X509_VERIFY_PARAM_set_flags.pod
doc/ssl/SSL_set1_host.pod
include/openssl/ssl.h
include/openssl/x509_vfy.h
ssl/ssl_lib.c

index 05c7852..2ea39c8 100644 (file)
@@ -301,7 +301,7 @@ int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,
     return 1;
 }
 
-unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param)
+unsigned long X509_VERIFY_PARAM_get_flags(const X509_VERIFY_PARAM *param)
 {
     return param->flags;
 }
@@ -396,7 +396,7 @@ void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
     param->hostflags = flags;
 }
 
-char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param)
+const char *X509_VERIFY_PARAM_get0_peername(const X509_VERIFY_PARAM *param)
 {
     return param->peername;
 }
index 2800cd4..528a53a 100644 (file)
@@ -12,7 +12,7 @@ X509_VERIFY_PARAM_set_flags, X509_VERIFY_PARAM_clear_flags, X509_VERIFY_PARAM_ge
                                         unsigned long flags);
  int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,
                                         unsigned long flags);
- unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param);
+ unsigned long X509_VERIFY_PARAM_get_flags(const X509_VERIFY_PARAM *param);
 
  int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose);
  int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust);
@@ -37,7 +37,7 @@ X509_VERIFY_PARAM_set_flags, X509_VERIFY_PARAM_clear_flags, X509_VERIFY_PARAM_ge
                                  const char *name, size_t namelen);
  void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
                                       unsigned int flags);
- char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param);
+ const char *X509_VERIFY_PARAM_get0_peername(const X509_VERIFY_PARAM *param);
  int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
                                  const char *email, size_t emaillen);
  int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
index 3339a0e..d254fe7 100644 (file)
@@ -12,7 +12,7 @@ SSL server verification parameters
  int SSL_set1_host(SSL *s, const char *hostname);
  int SSL_add1_host(SSL *s, const char *hostname);
  void SSL_set_hostflags(SSL *s, unsigned int flags);
- const char *SSL_get0_peername(SSL *s);
+ const char *SSL_get0_peername(const SSL *s);
 
 =head1 DESCRIPTION
 
index af6d9b5..1fcdbd2 100644 (file)
@@ -1493,7 +1493,7 @@ __owur int SSL_set_trust(SSL *s, int trust);
 
 __owur int SSL_set1_host(SSL *s, const char *hostname);
 __owur int SSL_add1_host(SSL *s, const char *hostname);
-__owur const char *SSL_get0_peername(SSL *s);
+__owur const char *SSL_get0_peername(const SSL *s);
 void SSL_set_hostflags(SSL *s, unsigned int flags);
 
 __owur int SSL_CTX_dane_enable(SSL_CTX *ctx);
index cab8005..12984f0 100644 (file)
@@ -453,7 +453,7 @@ int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param,
                                 unsigned long flags);
 int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,
                                   unsigned long flags);
-unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param);
+unsigned long X509_VERIFY_PARAM_get_flags(const X509_VERIFY_PARAM *param);
 int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose);
 int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust);
 void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth);
@@ -470,7 +470,7 @@ int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
                                 const char *name, size_t namelen);
 void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
                                      unsigned int flags);
-char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *);
+const char *X509_VERIFY_PARAM_get0_peername(const X509_VERIFY_PARAM *);
 void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *);
 int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
                                  const char *email, size_t emaillen);
index bd0fbf8..27a16ef 100644 (file)
@@ -795,7 +795,7 @@ void SSL_set_hostflags(SSL *s, unsigned int flags)
     X509_VERIFY_PARAM_set_hostflags(s->param, flags);
 }
 
-const char *SSL_get0_peername(SSL *s)
+const char *SSL_get0_peername(const SSL *s)
 {
     return X509_VERIFY_PARAM_get0_peername(s->param);
 }