summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rsa/rsa_oaep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_oaep.c')
-rw-r--r--src/lib/libcrypto/rsa/rsa_oaep.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_oaep.c b/src/lib/libcrypto/rsa/rsa_oaep.c
index df288fa615..1e862a99e0 100644
--- a/src/lib/libcrypto/rsa/rsa_oaep.c
+++ b/src/lib/libcrypto/rsa/rsa_oaep.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_oaep.c,v 1.18 2014/07/09 17:08:40 miod Exp $ */ 1/* $OpenBSD: rsa_oaep.c,v 1.19 2014/07/09 19:51:38 jsing Exp $ */
2/* Written by Ulf Moeller. This software is distributed on an "AS IS" 2/* Written by Ulf Moeller. This software is distributed on an "AS IS"
3 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */ 3 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */
4 4
@@ -8,7 +8,7 @@
8 * <URL: http://www.shoup.net/papers/oaep.ps.Z> 8 * <URL: http://www.shoup.net/papers/oaep.ps.Z>
9 * for problems with the security proof for the 9 * for problems with the security proof for the
10 * original OAEP scheme, which EME-OAEP is based on. 10 * original OAEP scheme, which EME-OAEP is based on.
11 * 11 *
12 * A new proof can be found in E. Fujisaki, T. Okamoto, 12 * A new proof can be found in E. Fujisaki, T. Okamoto,
13 * D. Pointcheval, J. Stern, "RSA-OEAP is Still Alive!", 13 * D. Pointcheval, J. Stern, "RSA-OEAP is Still Alive!",
14 * Dec. 2000, <URL: http://eprint.iacr.org/2000/061/>. 14 * Dec. 2000, <URL: http://eprint.iacr.org/2000/061/>.
@@ -29,7 +29,7 @@
29#include <openssl/sha.h> 29#include <openssl/sha.h>
30 30
31static int MGF1(unsigned char *mask, long len, const unsigned char *seed, 31static int MGF1(unsigned char *mask, long len, const unsigned char *seed,
32 long seedlen); 32 long seedlen);
33 33
34int 34int
35RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, 35RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
@@ -142,7 +142,7 @@ RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,
142 return -1; 142 return -1;
143 for (i = 0; i < SHA_DIGEST_LENGTH; i++) 143 for (i = 0; i < SHA_DIGEST_LENGTH; i++)
144 seed[i] ^= padded_from[i]; 144 seed[i] ^= padded_from[i];
145 145
146 if (MGF1(db, dblen, seed, SHA_DIGEST_LENGTH)) 146 if (MGF1(db, dblen, seed, SHA_DIGEST_LENGTH))
147 return -1; 147 return -1;
148 for (i = 0; i < dblen; i++) 148 for (i = 0; i < dblen; i++)
@@ -204,7 +204,7 @@ PKCS1_MGF1(unsigned char *mask, long len, const unsigned char *seed,
204 cnt[1] = (unsigned char)((i >> 16) & 255); 204 cnt[1] = (unsigned char)((i >> 16) & 255);
205 cnt[2] = (unsigned char)((i >> 8)) & 255; 205 cnt[2] = (unsigned char)((i >> 8)) & 255;
206 cnt[3] = (unsigned char)(i & 255); 206 cnt[3] = (unsigned char)(i & 255);
207 if (!EVP_DigestInit_ex(&c,dgst, NULL) || 207 if (!EVP_DigestInit_ex(&c, dgst, NULL) ||
208 !EVP_DigestUpdate(&c, seed, seedlen) || 208 !EVP_DigestUpdate(&c, seed, seedlen) ||
209 !EVP_DigestUpdate(&c, cnt, 4)) 209 !EVP_DigestUpdate(&c, cnt, 4))
210 goto err; 210 goto err;