]> granicus.if.org Git - openssl/commitdiff
Oops, moved too much.
authorDr. Stephen Henson <steve@openssl.org>
Fri, 26 Jun 2009 23:56:10 +0000 (23:56 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Fri, 26 Jun 2009 23:56:10 +0000 (23:56 +0000)
crypto/rsa/rsa_oaep.c

index 697d5779771801e2a6b22eef8bc254f27e0bce2a..546ae5fcb2edc01a0ff45d5daf357c81f5955a89 100644 (file)
@@ -52,6 +52,10 @@ int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
                return 0;
                }
 
+       to[0] = 0;
+       seed = to + 1;
+       db = to + SHA_DIGEST_LENGTH + 1;
+
        EVP_Digest((void *)param, plen, db, NULL, EVP_sha1(), NULL);
        memset(db + SHA_DIGEST_LENGTH, 0,
                emlen - flen - 2 * SHA_DIGEST_LENGTH - 1);
@@ -65,10 +69,6 @@ int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
           20);
 #endif
 
-       to[0] = 0;
-       seed = to + 1;
-       db = to + SHA_DIGEST_LENGTH + 1;
-
        dbmask = OPENSSL_malloc(emlen - SHA_DIGEST_LENGTH);
        if (dbmask == NULL)
                {