Skip to content

Commit

Permalink
2004-09-29 Sebastien Pouliot <sebastien@ximian.com>
Browse files Browse the repository at this point in the history
	* RSAManaged.cs: KeySize is now always a multiple of 8 bits.
	Fix #66929.

svn path=/branches/mono-1-0/mcs/; revision=34533
  • Loading branch information
Sebastien Pouliot committed Sep 29, 2004
1 parent 19f3882 commit 1f43385
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
5 changes: 5 additions & 0 deletions mcs/class/Mono.Security/Mono.Security.Cryptography/ChangeLog
@@ -1,3 +1,8 @@
2004-09-29 Sebastien Pouliot <sebastien@ximian.com>

* RSAManaged.cs: KeySize is now always a multiple of 8 bits.
Fix #66929.

2004-06-23 Sebastien Pouliot <sebastien@ximian.com>

* SymmetricTransform.cs: Reduce by one the number of block when
Expand Down
10 changes: 8 additions & 2 deletions mcs/class/Mono.Security/Mono.Security.Cryptography/RSAManaged.cs
Expand Up @@ -13,6 +13,8 @@
// See bouncycastle.txt for license.
//

//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
Expand Down Expand Up @@ -147,8 +149,12 @@ private void GenerateKeyPair ()
public override int KeySize {
get {
// in case keypair hasn't been (yet) generated
if (keypairGenerated)
return n.BitCount ();
if (keypairGenerated) {
int ks = n.BitCount ();
if ((ks & 7) != 0)
ks = ks + (8 - (ks & 7));
return ks;
}
else
return base.KeySize;
}
Expand Down
5 changes: 5 additions & 0 deletions mcs/class/corlib/Mono.Security.Cryptography/ChangeLog
@@ -1,3 +1,8 @@
2004-09-29 Sebastien Pouliot <sebastien@ximian.com>

* RSAManaged.cs: KeySize is now always a multiple of 8 bits.
Fix #66929.

2004-06-23 Sebastien Pouliot <sebastien@ximian.com>

* SymmetricTransform.cs: Reduce by one the number of block when
Expand Down
8 changes: 6 additions & 2 deletions mcs/class/corlib/Mono.Security.Cryptography/RSAManaged.cs
Expand Up @@ -149,8 +149,12 @@ private void GenerateKeyPair ()
public override int KeySize {
get {
// in case keypair hasn't been (yet) generated
if (keypairGenerated)
return n.BitCount ();
if (keypairGenerated) {
int ks = n.BitCount ();
if ((ks & 7) != 0)
ks = ks + (8 - (ks & 7));
return ks;
}
else
return base.KeySize;
}
Expand Down

0 comments on commit 1f43385

Please sign in to comment.