[openssl] master update

Matt Caswell matt at openssl.org
Wed Jun 16 14:31:57 UTC 2021


The branch master has been updated
       via  218e9969fd90ded078a1a558c110cd14e2272a35 (commit)
      from  afb254d02b20e877230367c0799ab27505b585f4 (commit)


- Log -----------------------------------------------------------------
commit 218e9969fd90ded078a1a558c110cd14e2272a35
Author: Richard Levitte <levitte at openssl.org>
Date:   Tue Jun 15 14:59:17 2021 +0200

    DSO: Fix the VMS DSO name converter to actually do something
    
    This function has never before actually done its work.  This wasn't
    discovered before, because its output wasn't important before the FIPS
    provider self test started using its value.
    
    This function is now made to insert the VMS DSO extension (".EXE") at
    the end of the filename, being careful to make sure what can be a
    typical VMS generation number (separated from the file name with a
    ';') remains at the end.
    
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/15765)

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

Summary of changes:
 crypto/dso/dso_vms.c | 36 +++++++++++++++++++++++++++++++-----
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/crypto/dso/dso_vms.c b/crypto/dso/dso_vms.c
index 1230a2c793..dd7402bfa2 100644
--- a/crypto/dso/dso_vms.c
+++ b/crypto/dso/dso_vms.c
@@ -453,11 +453,37 @@ static char *vms_merger(DSO *dso, const char *filespec1,
 
 static char *vms_name_converter(DSO *dso, const char *filename)
 {
-    int len = strlen(filename);
-    char *not_translated = OPENSSL_malloc(len + 1);
-    if (not_translated != NULL)
-        strcpy(not_translated, filename);
-    return not_translated;
+    char *translated;
+    int len, transform;
+    const char *p;
+
+    len = strlen(filename);
+
+    p = strchr(filename, ':');
+    if (p != NULL) {
+        transform = 0;
+    } else {
+        p = filename;
+        transform = (strrchr(p, '>') == NULL && strrchr(p, ']') == NULL);
+    }
+
+    if (transform) {
+        int rsize = len + sizeof(DSO_EXTENSION);
+
+        if ((translated = OPENSSL_malloc(rsize)) != NULL) {
+            p = strrchr(filename, ';');
+            if (p != NULL)
+                len = p - filename;
+            strncpy(translated, filename, len);
+            translated[len] = '\0';
+            strcat(translated, DSO_EXTENSION);
+            if (p != NULL)
+                strcat(translated, p);
+        }
+    } else {
+        translated = OPENSSL_strdup(filename);
+    }
+    return translated;
 }
 
 #endif                          /* OPENSSL_SYS_VMS */


More information about the openssl-commits mailing list