143 |
|
|
144 |
if( (parms = strstr (parms, "<GnupgKeyParms " )) != NULL |
if( (parms = strstr (parms, "<GnupgKeyParms " )) != NULL |
145 |
&& (s = strchr (parms, '>')) != NULL |
&& (s = strchr (parms, '>')) != NULL |
146 |
&& (sx = strstr( parms, "format=\"internal\"" )) |
&& (sx = strstr( parms, "format=\"internal\"" )) != NULL |
147 |
&& sx < s |
&& sx < s |
148 |
&& (s2 = strstr( s+1, "</GnupgKeyParms>" )) != NULL) { |
&& (s2 = strstr( s+1, "</GnupgKeyParms>" )) != NULL) { |
149 |
/* fixme: check that there are no control statements inside */ |
/* fixme: check that there are no control statements inside */ |
381 |
|
|
382 |
|
|
383 |
gpgme_error_t |
gpgme_error_t |
384 |
gpgme_op_genkey_auto( const char * params, gpgme_progress_cb_t prog_cb, |
gpgme_op_genkey_auto (const char *params, gpgme_progress_cb_t prog_cb, |
385 |
char ** fpr ) |
char **fpr) |
386 |
{ |
{ |
387 |
gpgme_error_t err = 0; |
gpgme_error_t err = 0; |
388 |
gpgme_ctx_t ctx; |
gpgme_ctx_t ctx; |
389 |
|
|
390 |
err = gpgme_new( &ctx ); |
err = gpgme_new(&ctx); |
391 |
if( err ) |
if (err) |
392 |
return err; |
return err; |
393 |
|
if (prog_cb) |
394 |
if( prog_cb ) |
gpgme_set_progress_cb (ctx, prog_cb, NULL); |
395 |
gpgme_set_progress_cb( ctx, prog_cb, NULL ); |
err = gpgme_op_genkey (ctx, params, NULL, NULL); |
396 |
err = gpgme_op_genkey( ctx, params, NULL, NULL ); |
if (fpr) |
397 |
if( fpr ) |
*fpr = ctx->keygen_fpr? strdup (ctx->keygen_fpr) : NULL; |
398 |
*fpr = ctx->keygen_fpr? strdup( ctx->keygen_fpr ) : NULL; |
gpgme_release (ctx); |
|
gpgme_release( ctx ); |
|
399 |
return err; |
return err; |
400 |
} /* gpgme_op_genkey_auto */ |
} /* gpgme_op_genkey_auto */ |