/** * Parse a {@link ServerSRPParams} from an {@link InputStream}. * * @param input * the {@link InputStream} to parse from. * @return a {@link ServerSRPParams} object. * @throws IOException */ public static ServerSrpParams Parse(Stream input) { BigInteger N = TlsSrpUtilities.ReadSrpParameter(input); BigInteger g = TlsSrpUtilities.ReadSrpParameter(input); byte[] s = TlsUtilities.ReadOpaque8(input); BigInteger B = TlsSrpUtilities.ReadSrpParameter(input); return(new ServerSrpParams(N, g, s, B)); }
public override void ProcessClientKeyExchange(Stream input) { try { mSrpPeerCredentials = Srp6Utilities.ValidatePublicValue(mSrpGroup.N, TlsSrpUtilities.ReadSrpParameter(input)); } catch (CryptoException alertCause) { throw new TlsFatalAlert(47, alertCause); } mContext.SecurityParameters.srpIdentity = Arrays.Clone(mIdentity); }
public override void ProcessClientKeyExchange(Stream input) { /* * RFC 5054 2.5.4: The server MUST abort the handshake with an "illegal_parameter" alert if * A % N = 0. */ try { this.mSrpPeerCredentials = Srp6Utilities.ValidatePublicValue(mSrpGroup.N, TlsSrpUtilities.ReadSrpParameter(input)); } catch (CryptoException e) { throw new TlsFatalAlert(AlertDescription.illegal_parameter, e); } mContext.SecurityParameters.srpIdentity = Arrays.Clone(mIdentity); }