Beispiel #1
0
static int dsa_cb(int p, int n, BN_GENCB *arg)
{
    char c = '*';
    static int ok = 0, num = 0;

    if (p == 0) {
        c = '.';
        num++;
    };
    if (p == 1)
        c = '+';
    if (p == 2) {
        c = '*';
        ok++;
    }
    if (p == 3)
        c = '\n';
    BIO_write(BN_GENCB_get_arg(arg), &c, 1);
    (void)BIO_flush(BN_GENCB_get_arg(arg));

    if (!ok && (p == 0) && (num > 1)) {
        BIO_printf(BN_GENCB_get_arg(arg), "error in dsatest\n");
        return 0;
    }
    return 1;
}
Beispiel #2
0
static int dh_cb(int p, int n, BN_GENCB *cb)
{
    static const char symbols[] = ".+*\n";
    char c = (p >= 0 && (size_t)p < sizeof(symbols) - 1) ? symbols[p] : '?';

    BIO_write(BN_GENCB_get_arg(cb), &c, 1);
    (void)BIO_flush(BN_GENCB_get_arg(cb));
    return 1;
}
Beispiel #3
0
static int dh_cb(int p, int n, BN_GENCB *cb)
{
    char c = '*';

    if (p == 0)
        c = '.';
    if (p == 1)
        c = '+';
    if (p == 2)
        c = '*';
    if (p == 3)
        c = '\n';
    BIO_write(BN_GENCB_get_arg(cb), &c, 1);
    (void)BIO_flush(BN_GENCB_get_arg(cb));
    return 1;
}
Beispiel #4
0
static int trans_cb(int a, int b, BN_GENCB *gcb)
{
    EVP_PKEY_CTX *ctx = BN_GENCB_get_arg(gcb);
    ctx->keygen_info[0] = a;
    ctx->keygen_info[1] = b;
    return ctx->pkey_gencb(ctx);
}
Beispiel #5
0
static int check_erlang_interrupt(int maj, int min, BN_GENCB *ctxt)
{
    ErlNifEnv *env = BN_GENCB_get_arg(ctxt);

    if (!enif_is_current_process_alive(env)) {
	return 0;
    } else {
	return 1;
    }
}
Beispiel #6
0
static int dsa_cb(int p, int n, BN_GENCB *cb)
{
    char c = '*';

    if (p == 0)
        c = '.';
    if (p == 1)
        c = '+';
    if (p == 2)
        c = '*';
    if (p == 3)
        c = '\n';
    BIO_write(BN_GENCB_get_arg(cb), &c, 1);
    (void)BIO_flush(BN_GENCB_get_arg(cb));
# ifdef GENCB_TEST
    if (stop_keygen_flag)
        return 0;
# endif
    return 1;
}
Beispiel #7
0
static int
progress_cb(int p, int n, BN_GENCB *cb) {
	union {
		void *dptr;
		void (*fptr)(int);
	} u;

	UNUSED(n);

	u.dptr = BN_GENCB_get_arg(cb);
	if (u.fptr != NULL)
		u.fptr(p);
	return (1);
}