1
0
ミラー元 http://git.whoc.org.uk/git/password-manager.git 前回の同期 2025-12-24 19:57:01 +01:00

Fixed SRP check for negative values

このコミットが含まれているのは:
Giulio Cesare Solaroli
2015-02-16 18:20:49 +01:00
コミット 2a614c8946
3個のファイルの変更12行の追加6行の削除

ファイルの表示

@@ -151,7 +151,8 @@ Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, {
if (this._A == null) {
// Warning: this value should be strictly greater than zero
this._A = Clipperz.Crypto.SRP.g().powerModule(this.a(), Clipperz.Crypto.SRP.n());
if (this._A.equals(0) || negative(this._A)) {
// if (this._A.equals(0) || negative(this._A)) {
if (this._A.compare(Clipperz.Crypto.BigInt.ZERO) <= 0) {
MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to 0.");
throw Clipperz.Crypto.SRP.exception.InvalidValue;
}
@@ -179,7 +180,8 @@ Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, {
'set_B': function(aValue) {
// Warning: this value should be strictly greater than zero
this._B = aValue;
if (this._B.equals(0) || negative(this._B)) {
// if (this._B.equals(0) || negative(this._B)) {
if (this._B.compare(Clipperz.Crypto.BigInt.ZERO) <= 0) {
MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to 0.");
throw Clipperz.Crypto.SRP.exception.InvalidValue;
}

ファイルの表示

@@ -153,7 +153,8 @@ Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, {
if (this._A == null) {
// Warning: this value should be strictly greater than zero
this._A = Clipperz.Crypto.SRP.g().powerModule(this.a(), Clipperz.Crypto.SRP.n());
if (this._A.equals(0) || negative(this._A)) {
// if (this._A.equals(0) || negative(this._A)) {
if (this._A.compare(Clipperz.Crypto.BigInt.ZERO) <= 0) {
Clipperz.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to 0.");
throw Clipperz.Crypto.SRP.exception.InvalidValue;
}
@@ -181,7 +182,8 @@ Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, {
'set_B': function(aValue) {
// Warning: this value should be strictly greater than zero
this._B = aValue;
if (this._B.equals(0) || negative(this._B)) {
// if (this._B.equals(0) || negative(this._B)) {
if (this._B.compare(Clipperz.Crypto.BigInt.ZERO) <= 0) {
Clipperz.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to 0.");
throw Clipperz.Crypto.SRP.exception.InvalidValue;
}

ファイルの表示

@@ -151,7 +151,8 @@ Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, {
if (this._A == null) {
// Warning: this value should be strictly greater than zero
this._A = Clipperz.Crypto.SRP.g().powerModule(this.a(), Clipperz.Crypto.SRP.n());
if (this._A.equals(0) || negative(this._A)) {
// if (this._A.equals(0) || negative(this._A)) {
if (this._A.compare(Clipperz.Crypto.BigInt.ZERO) <= 0) {
Clipperz.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to 0.");
throw Clipperz.Crypto.SRP.exception.InvalidValue;
}
@@ -179,7 +180,8 @@ Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, {
'set_B': function(aValue) {
// Warning: this value should be strictly greater than zero
this._B = aValue;
if (this._B.equals(0) || negative(this._B)) {
// if (this._B.equals(0) || negative(this._B)) {
if (this._B.compare(Clipperz.Crypto.BigInt.ZERO) <= 0) {
Clipperz.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to 0.");
throw Clipperz.Crypto.SRP.exception.InvalidValue;
}