summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Hook <dgh@bouncycastle.org>2021-05-24 08:40:26 +1000
committerDavid Hook <dgh@bouncycastle.org>2021-05-24 08:40:26 +1000
commit8cdb0ed215f9baaf13fc01aea2935ece408e9131 (patch)
tree06d838fb084578e04d7704b3120a866ed42385b8
parentadded sha256 test vector (diff)
parentgithub #54 (diff)
downloadBouncyCastle.NET-ed25519-8cdb0ed215f9baaf13fc01aea2935ece408e9131.tar.xz
Merge remote-tracking branch 'origin/master'
-rw-r--r--crypto/Contributors.html3
-rw-r--r--crypto/src/security/CipherUtilities.cs10
2 files changed, 13 insertions, 0 deletions
diff --git a/crypto/Contributors.html b/crypto/Contributors.html
index cc7398b18..08830b522 100644
--- a/crypto/Contributors.html
+++ b/crypto/Contributors.html
@@ -168,6 +168,9 @@
             <li>
                 <p>Nathan Douthit (https://github.com/ndouthit) - Null policy fix for TimeStampTokenGenerator</p>
             </li>
+            <li>
+                <p>fabiogermann (https://github.com/fabiogermann) - Mixed definiton support for OAEPwithSHA256andMGF1withSHA1.<p>
+            </li>
 		</ul>
 	</body>
 </html>
diff --git a/crypto/src/security/CipherUtilities.cs b/crypto/src/security/CipherUtilities.cs
index fb2a31a56..79e3de794 100644
--- a/crypto/src/security/CipherUtilities.cs
+++ b/crypto/src/security/CipherUtilities.cs
@@ -89,6 +89,10 @@ namespace Org.BouncyCastle.Security
             OAEPWITHSHA_224ANDMGF1PADDING,
             OAEPWITHSHA256ANDMGF1PADDING,
             OAEPWITHSHA_256ANDMGF1PADDING,
+            OAEPWITHSHA256ANDMGF1WITHSHA256PADDING,
+            OAEPWITHSHA_256ANDMGF1WITHSHA_256PADDING,
+            OAEPWITHSHA256ANDMGF1WITHSHA1PADDING,
+            OAEPWITHSHA_256ANDMGF1WITHSHA_1PADDING,
             OAEPWITHSHA384ANDMGF1PADDING,
             OAEPWITHSHA_384ANDMGF1PADDING,
             OAEPWITHSHA512ANDMGF1PADDING,
@@ -571,8 +575,14 @@ namespace Org.BouncyCastle.Security
                         break;
                     case CipherPadding.OAEPWITHSHA256ANDMGF1PADDING:
                     case CipherPadding.OAEPWITHSHA_256ANDMGF1PADDING:
+                    case CipherPadding.OAEPWITHSHA256ANDMGF1WITHSHA256PADDING:
+                    case CipherPadding.OAEPWITHSHA_256ANDMGF1WITHSHA_256PADDING:
                         asymBlockCipher = new OaepEncoding(asymBlockCipher, new Sha256Digest());
                         break;
+                    case CipherPadding.OAEPWITHSHA256ANDMGF1WITHSHA1PADDING:
+                    case CipherPadding.OAEPWITHSHA_256ANDMGF1WITHSHA_1PADDING:
+                        asymBlockCipher = new OaepEncoding(asymBlockCipher, new Sha256Digest(), new Sha1Digest(), null);
+                        break;
                     case CipherPadding.OAEPWITHSHA384ANDMGF1PADDING:
                     case CipherPadding.OAEPWITHSHA_384ANDMGF1PADDING:
                         asymBlockCipher = new OaepEncoding(asymBlockCipher, new Sha384Digest());