[openssl-commits] [openssl] master update

Rich Salz rsalz at openssl.org
Fri Nov 13 21:36:53 UTC 2015


The branch master has been updated
       via  0704343f138a38d3882d5af2a4ebe8821e9a8f3a (commit)
      from  558ceae7e82f8a7a636224f9d2d6ec214ee980a2 (commit)


- Log -----------------------------------------------------------------
commit 0704343f138a38d3882d5af2a4ebe8821e9a8f3a
Author: Graeme Perrow <graeme.perrow at sap.com>
Date:   Sun Nov 1 20:15:23 2015 -0500

    RT32671: wrong multiple errs TS_check_status_info
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>
    Signed-off-by: Rich Salz <rsalz at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 crypto/ts/ts_rsp_verify.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/crypto/ts/ts_rsp_verify.c b/crypto/ts/ts_rsp_verify.c
index 84c9b31..5a69a94 100644
--- a/crypto/ts/ts_rsp_verify.c
+++ b/crypto/ts/ts_rsp_verify.c
@@ -88,11 +88,16 @@ static int ts_find_name(STACK_OF(GENERAL_NAME) *gen_names,
                         GENERAL_NAME *name);
 
 /*
+ * This must be large enough to hold all values in ts_status_text (with
+ * comma separator) or all text fields in ts_failure_info (also with comma).
+ */
+#define TS_STATUS_BUF_SIZE      256
+
+/*
  * Local mapping between response codes and descriptions.
- * Don't forget to change TS_STATUS_BUF_SIZE when modifying
- * the elements of this array.
  */
-static const char *ts_status_text[] = { "granted",
+static const char *ts_status_text[] = {
+    "granted",
     "grantedWithMods",
     "rejection",
     "waiting",
@@ -102,12 +107,6 @@ static const char *ts_status_text[] = { "granted",
 
 #define TS_STATUS_TEXT_SIZE     OSSL_NELEM(ts_status_text)
 
-/*
- * This must be greater or equal to the sum of the strings in TS_status_text
- * plus the number of its elements.
- */
-#define TS_STATUS_BUF_SIZE      256
-
 static struct {
     int code;
     const char *text;
@@ -122,8 +121,6 @@ static struct {
     {TS_INFO_SYSTEM_FAILURE, "systemFailure"}
 };
 
-#define TS_FAILURE_INFO_SIZE    OSSL_NELEM(ts_failure_info)
-
 
 /*-
  * This function carries out the following tasks:
@@ -445,7 +442,7 @@ static int ts_check_status_info(TS_RESP *response)
         return 1;
 
     /* There was an error, get the description in status_text. */
-    if (0 <= status && status < (long)TS_STATUS_TEXT_SIZE)
+    if (0 <= status && status < (long) OSSL_NELEM(ts_status_text))
         status_text = ts_status_text[status];
     else
         status_text = "unknown code";
@@ -462,7 +459,7 @@ static int ts_check_status_info(TS_RESP *response)
             if (ASN1_BIT_STRING_get_bit(info->failure_info,
                                         ts_failure_info[i].code)) {
                 if (!first)
-                    strcpy(failure_text, ",");
+                    strcat(failure_text, ",");
                 else
                     first = 0;
                 strcat(failure_text, ts_failure_info[i].text);


More information about the openssl-commits mailing list