Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-48779

Problem generating mnet cert with long non-latin site name

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.3, 2.8.1, 2.9
    • Fix Version/s: 2.7.5, 2.8.3
    • Component/s: MNet
    • Labels:
    • Testing Instructions:
      Hide

      First try before applying patch.
      1. Setup mnet using advanced config page.
      2. Set sitename to something longer then 64 byte using 2-byte unicode symbols. Use odd number of spaces or latin symbols in positions less then 64. You can copy/pasetr sitename "ЫЫЫЫЫЫЫ ыыыыыыыыыыыы ыыыыыыыы ыыыыыыыыыыыы ыыыы" for example.
      3. Try regenerate key on page moodle/admin/mnet/index.php. You'll get error.
      Apply patch and check that there is no error.

      Show
      First try before applying patch. 1. Setup mnet using advanced config page. 2. Set sitename to something longer then 64 byte using 2-byte unicode symbols. Use odd number of spaces or latin symbols in positions less then 64. You can copy/pasetr sitename "ЫЫЫЫЫЫЫ ыыыыыыыыыыыы ыыыыыыыы ыыыыыыыыыыыы ыыыы" for example. 3. Try regenerate key on page moodle/admin/mnet/index.php. You'll get error. Apply patch and check that there is no error.
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      1. Set sitename to something longer then 64 byte, using 2-byte unicode symbols. You can copy/pasetr sitename "ЫЫЫЫЫЫЫ ыыыыыыыыыыыы ыыыыыыыы ыыыыыыыыыыыы ыыыы" for example.
      2. Regenerate key on page moodle/admin/mnet/index.php. You'l get error.
      The problem is in moodle/mnet/lib.php line 397 (in 2.8.1)
      $dn[$key] = substr($dn[$key], 0, $length);
      should be
      $dn[$key] = core_text::substr($dn[$key], 0, $length);
      using non-multibyte substr in some cases breaks line inslide multibyte character, and this breaks certificate creation procedure.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  2/Feb/15