Query regarding EVP_PKEY_CTX_set_cb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

Can you please help to understand the use of the callback function that can be set during key generation?

1> For ex: In the OpenSSL 3.0 code, the callback "genrsa_cb" is defined in the file "apps/genrsa.c" :

      What exactly is being done in this callback function? What does EVP_PKEY_CTX_get_keygen_info() return in this case during RSA key generation?
      
static int genrsa_cb(EVP_PKEY_CTX *ctx)
{
    char c = '*';
    BIO *b = EVP_PKEY_CTX_get_app_data(ctx);
    int p = EVP_PKEY_CTX_get_keygen_info(ctx, 0);

    if (!verbose)
        return 1;

    if (p == 0)
        c = '.';
    if (p == 1)
        c = '+';
    if (p == 2)
        c = '*';
    if (p == 3)
        c = '\n';
    BIO_write(b, &c, 1);
    (void)BIO_flush(b);
    return 1;
}

What can be done in these callback functions?

2> Is EVP_PKEY_CTX_set_cb API replacement for the deprecated BN_GENCB_set_old in OpenSSL 3.0 code ?

Thanks
Bala



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux