openssl w/ rsaref openssh won't configure

Ed Eden ede370 at stl.rural.usda.gov
Sat May 13 01:29:52 EST 2000


I kind of merged rsa_test and came up with the following that seems to
work with rsaref. The problem areas on the original was 32 for the key
gen, rsaref likes 1024 at least. And rsaref likes RSA_PKCS1_PADDING but
not RSA_NO_PADDING for some reason. I am not versed in ssl but just
tried different things with debugging until it worked. I assume it will
work with the non-rsaref also.



#line 2032 "configure"
#include "confdefs.h"

#include <string.h>
#include <openssl/rand.h>
#include <openssl/rsa.h>
#include <openssl/bn.h>
#include <openssl/sha.h>
int main(void)
{
 int num;
        RSA *key; char a[2048],b[2048];
 static unsigned char ptext_ex[] = "This is the text to encrypt";
        unsigned char ctext[256];
        unsigned char ptext[256];

        memset(a, 0, sizeof(a));memset(b, 0, sizeof(b));
        RAND_add(a, sizeof(a), sizeof(a));
        key=RSA_generate_key(512,3,NULL,NULL);
        if (key==NULL) return(1);
 num=RSA_public_encrypt(sizeof(ptext_ex)-1,ptext_ex,ctext,
    key,RSA_PKCS1_PADDING);

return(-1==RSA_private_decrypt(num,ctext,ptext,key,RSA_PKCS1_PADDING));
}







More information about the openssh-unix-dev mailing list