Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-30389

Calls to `encryption_crypt` currently pass uninitialized `dlen`, should pass correct buffer size

Details

    Description

      Calls to `encryption_crypt` (service_encryption.h) seem to generally receive an uninitialized `*dlen`, which it passes on to the encryption service calls. This is an output value that receives the number of bytes written to the `dst` buffer. This should be updated to pass the correct length of the `dst` buffer instead of an uninitialized value.

      There is no problem for encryption schemes where it can be assumed that `dlen == slen`. However, in cases where the two may not be equal, it would be good to allow for debug assertions validating that the destination buffer is large enough.

      In general, the buffer should be large enough, but it is currently impossible to verify this is true in code. Finding the information in source is also difficult, so plugin writers have no way to verify they aren't creating buffer overwrites.

      Attachments

        Activity

          tgross35 Trevor Gross created issue -
          serg Sergei Golubchik made changes -
          Field Original Value New Value
          Assignee Sergei Golubchik [ serg ]
          serg Sergei Golubchik made changes -
          Fix Version/s 11.0 [ 28320 ]
          serg Sergei Golubchik made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          serg Sergei Golubchik made changes -
          Status In Progress [ 3 ] In Review [ 10002 ]
          serg Sergei Golubchik made changes -
          Assignee Sergei Golubchik [ serg ] Marko Mäkelä [ marko ]
          marko Marko Mäkelä made changes -
          Assignee Marko Mäkelä [ marko ] Sergei Golubchik [ serg ]
          Status In Review [ 10002 ] Stalled [ 10000 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 11.2.1 [ 29034 ]
          Fix Version/s 11.0 [ 28320 ]
          Resolution Fixed [ 1 ]
          Status Stalled [ 10000 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 11.0.3 [ 28920 ]
          Fix Version/s 11.1.2 [ 28921 ]

          People

            serg Sergei Golubchik
            tgross35 Trevor Gross
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.