| 674 | } |
| 675 | |
| 676 | static const char *set_crypto_passphrase(cmd_parms * cmd, void *config, const char *arg) |
| 677 | { |
| 678 | int arglen = strlen(arg); |
| 679 | char **argv; |
| 680 | char *result; |
| 681 | const char **passphrase; |
| 682 | session_crypto_dir_conf *dconf = (session_crypto_dir_conf *) config; |
| 683 | |
| 684 | passphrase = apr_array_push(dconf->passphrases); |
| 685 | |
| 686 | if ((arglen > 5) && strncmp(arg, "exec:", 5) == 0) { |
| 687 | if (apr_tokenize_to_argv(arg+5, &argv, cmd->temp_pool) != APR_SUCCESS) { |
| 688 | return apr_pstrcat(cmd->pool, |
| 689 | "Unable to parse exec arguments from ", |
| 690 | arg+5, NULL); |
| 691 | } |
| 692 | argv[0] = ap_server_root_relative(cmd->temp_pool, argv[0]); |
| 693 | |
| 694 | if (!argv[0]) { |
| 695 | return apr_pstrcat(cmd->pool, |
| 696 | "Invalid SessionCryptoPassphrase exec location:", |
| 697 | arg+5, NULL); |
| 698 | } |
| 699 | result = ap_get_exec_line(cmd->pool, |
| 700 | (const char*)argv[0], (const char * const *)argv); |
| 701 | |
| 702 | if(!result) { |
| 703 | return apr_pstrcat(cmd->pool, |
| 704 | "Unable to get bind password from exec of ", |
| 705 | arg+5, NULL); |
| 706 | } |
| 707 | *passphrase = result; |
| 708 | } |
| 709 | else { |
| 710 | *passphrase = arg; |
| 711 | } |
| 712 | |
| 713 | dconf->passphrases_set = 1; |
| 714 | |
| 715 | return NULL; |
| 716 | } |
| 717 | |
| 718 | static const char *set_crypto_passphrase_file(cmd_parms *cmd, void *config, |
| 719 | const char *filename) |
no test coverage detected