Lines 759-764
static WERROR create_heimdal_rsa_key(TALLOC_CTX *ctx, hx509_context *hctx,
|
Link Here
|
---|
|
759 |
uint8_t *p0, *p; |
759 |
uint8_t *p0, *p; |
760 |
size_t len; |
760 |
size_t len; |
761 |
int bits = 2048; |
761 |
int bits = 2048; |
|
|
762 |
int RSA_returned_bits; |
762 |
|
763 |
|
763 |
*_rsa = NULL; |
764 |
*_rsa = NULL; |
764 |
|
765 |
|
Lines 776-786
static WERROR create_heimdal_rsa_key(TALLOC_CTX *ctx, hx509_context *hctx,
|
Link Here
|
---|
|
776 |
return WERR_INTERNAL_ERROR; |
777 |
return WERR_INTERNAL_ERROR; |
777 |
} |
778 |
} |
778 |
|
779 |
|
779 |
ret = RSA_generate_key_ex(rsa, bits, pub_expo, NULL); |
780 |
while (RSA_returned_bits != bits) { |
780 |
if(ret != 1) { |
781 |
ret = RSA_generate_key_ex(rsa, bits, pub_expo, NULL); |
781 |
RSA_free(rsa); |
782 |
if(ret != 1) { |
782 |
BN_free(pub_expo); |
783 |
RSA_free(rsa); |
783 |
return WERR_INTERNAL_ERROR; |
784 |
BN_free(pub_expo); |
|
|
785 |
return WERR_INTERNAL_ERROR; |
786 |
} |
787 |
RSA_returned_bits = BN_num_bits(rsa->n); |
788 |
DEBUG(6, ("RSA_generate_key_ex returned %d Bits\n", RSA_returned_bits)); |
784 |
} |
789 |
} |
785 |
BN_free(pub_expo); |
790 |
BN_free(pub_expo); |
786 |
|
791 |
|
787 |
- |
|
|