Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Limiting the voucher code to 6 characters

    Captive Portal
    2
    5
    1.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ?
      A Former User
      last edited by

      Hello
      I am running pfsense 2.5.1 and for practical reason I need to shorten the voucher code lenght in the captive portal to 6 characters.
      Is there a practical way to do that?
      Thanks

      1 Reply Last reply Reply Quote 0
      • ?
        A Former User
        last edited by

        I have tried the method in the forum to generate new private key using the command line:

        openssl genrsa 30 > key.private

        But when I try to retrive the key with the command :

        cat key.private

        I get the following system error :

        Generating RSA private key, 30 bit long modulus (2 primes)
        34371026944:error:04081078:rsa routines:rsa_builtin_keygen:key size too small:/build/ce-crossbuild-251/sources/FreeBSD-src/crypto/openssl/crypto/rsa/rsa_gen.c:78:

        same thing for the key.public

        I have tried to change the 30 value to a longer size but same issue

        That methos was working with previous release of pfsense

        1 Reply Last reply Reply Quote 0
        • ?
          A Former User
          last edited by

          Looking at error:04081078 it is somthing that is build in the FreeBSD system and it require a 512 bit minimu key lenght.
          So maybe the solution will be to generate a key with another system that accept 30 bit lenght ?????
          Any ideas welcome

          F 1 Reply Last reply Reply Quote 1
          • F
            free4 Rebel Alliance @A Former User
            last edited by free4

            @pierrelyon the issue does not come from pfsense, but from openssl itself

            Netgate found a workaround : use PHP to generate the keys instead of patching openssl

            you could use this workaround too

            more info here : https://redmine.pfsense.org/issues/9443

            and
            https://github.com/openssl/openssl/commit/cac19d19e7d6f252ff9aea60d85e0c0fd71a117f

            1 Reply Last reply Reply Quote 0
            • ?
              A Former User
              last edited by

              Finally I found out a workaround
              I have another pfsense box with version 2.4.5 and on that one I was able to generate a short private and public key .
              So I copy paste them to the 2.5.1 box ... and bingo it works !
              Six character long voucher code 😊

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.