{ new SecureRandom ().nextBytes(sIV); }
getDefaultPRNG().nextBytes(sIV);
  private void parseO(final String o) throws AuthenticationException  {    this.replayDetection = false;    boolean integrity = false;    boolean confidentiality = false;    String option;    int i;    final StringTokenizer st = new StringTokenizer(o.toLowerCase(), ",");    while (st.hasMoreTokens())      {        option = st.nextToken();        if (DEBUG && debuglevel > 6)          debug(TRACE, "option: <" + option + ">");        if (option.equals(SRPRegistry.OPTION_REPLAY_DETECTION))          {            replayDetection = true;          }        else if (option.startsWith(SRPRegistry.OPTION_INTEGRITY + "="))          {            if (integrity)              {                throw new AuthenticationException(                                                  "Only one integrity algorithm may be chosen");              }            else              {                option = option.substring(option.indexOf('=') + 1);                if (DEBUG && debuglevel > 6)                  debug(TRACE, "algorithm: <" + option + ">");                for (i = 0; i < SRPRegistry.INTEGRITY_ALGORITHMS.length; i++)                  {                    if (SRPRegistry.INTEGRITY_ALGORITHMS[i].equals(option))                      {                        chosenIntegrityAlgorithm = option;                        integrity = true;                        break;                      }                  }                if (!integrity)                  {                    throw new AuthenticationException(                                                      "Unknown integrity algorithm: "                                                          + option);                  }              }          }        else if (option.startsWith(SRPRegistry.OPTION_CONFIDENTIALITY + "="))          {            if (confidentiality)              {                throw new AuthenticationException(                                                  "Only one confidentiality algorithm may be chosen");              }            else              {                option = option.substring(option.indexOf('=') + 1);                if (DEBUG && debuglevel > 6)                  debug(TRACE, "algorithm: <" + option + ">");                for (i = 0; i < SRPRegistry.CONFIDENTIALITY_ALGORITHMS.length; i++)                  {                    if (SRPRegistry.CONFIDENTIALITY_ALGORITHMS[i].equals(option))                      {                        chosenConfidentialityAlgorithm = option;                        confidentiality = true;                        break;                      }                  }                if (!confidentiality)                  {                    throw new AuthenticationException(                                                      "Unknown confidentiality algorithm: "                                                          + option);                  }              }          }        else if (option.startsWith(SRPRegistry.OPTION_MAX_BUFFER_SIZE + "="))          {            final String maxBufferSize = option.substring(option.indexOf('=') + 1);            try              {                rawSendSize = Integer.parseInt(maxBufferSize);                if (rawSendSize > Registry.SASL_BUFFER_MAX_LIMIT                    || rawSendSize < 1)                  throw new AuthenticationException(                                                    "Illegal value for 'maxbuffersize' option");              }            catch (NumberFormatException x)              {                throw new AuthenticationException(                                                  SRPRegistry.OPTION_MAX_BUFFER_SIZE                                                      + "="                                                      + String.valueOf(maxBufferSize),                                                  x);              }          }      }    // check if client did the right thing    if (replayDetection)      {        if (!integrity)          {            throw new AuthenticationException(                                              "Missing integrity protection algorithm "                                                  + "but replay detection is chosen");          }      }    if (mandatory.equals(SRPRegistry.OPTION_REPLAY_DETECTION))      {        if (!replayDetection)          {            throw new AuthenticationException(                                              "Replay detection is mandatory but was not chosen");          }      }    if (mandatory.equals(SRPRegistry.OPTION_INTEGRITY))      {        if (!integrity)          {            throw new AuthenticationException(                                              "Integrity protection is mandatory but was not chosen");          }      }    if (mandatory.equals(SRPRegistry.OPTION_CONFIDENTIALITY))      {        if (!confidentiality)          {            throw new AuthenticationException(                                              "Confidentiality is mandatory but was not chosen");          }      }    int blockSize = 0;    if (chosenConfidentialityAlgorithm != null)      {        final IBlockCipher cipher = CipherFactory.getInstance(chosenConfidentialityAlgorithm);        if (cipher != null)          {            blockSize = cipher.defaultBlockSize();          }        else          { // should not happen            throw new AuthenticationException("Confidentiality algorithm ("                                              + chosenConfidentialityAlgorithm                                              + ") not available");          }      }    sIV = new byte[blockSize];    if (blockSize > 0)      {        new SecureRandom ().nextBytes(sIV);      }  }