diff --git a/core/src/console/console.cc b/core/src/console/console.cc index 63a0fcf7b8f..6f970557c24 100644 --- a/core/src/console/console.cc +++ b/core/src/console/console.cc @@ -1072,49 +1072,6 @@ static bool SelectDirector(const char *director, DirectorResource **ret_dir, Con return 1; } -/** - * Callback calling director console connection -*/ -static int dir_psk_client_callback(char *identity, - unsigned int max_identity_len, - unsigned char *psk, - unsigned int max_psk_len) { - - Dmsg0(100, "dir_psk_client_callback"); - - int result = 0; - - if (NULL != dir && NULL != dir->password.value) { - if (p_encoding_clear == dir->password.encoding) { - /* plain password */ - } else if (p_encoding_md5 == dir->password.encoding) { - /* md5 string */ - /* convert the PSK key to binary */ - result = hex2bin(dir->password.value, psk, max_psk_len); - } else { - /* hex password encoding? */ - } - } else { - Dmsg0(100, "Passowrd not set in Director Config\n"); - result = 0; - } - - if (result == 0 || result > (int)max_psk_len) { - Dmsg1(100, "Error, Could not convert PSK key '%s' to binary key\n", dir->password.value); - result = 0; - } else { - static char *psk_identity = (char *)"Nasenbaer"; - - int ret = Bsnprintf(identity, max_identity_len, "%s", psk_identity); - if (ret < 0 || (unsigned int)ret > max_identity_len) { - Dmsg0(100, "Error, psk_identify too long\n"); - result = 0; - } - } - - return result; -} - /* * Main Bareos Console -- User Interface Program */ diff --git a/core/src/lib/tls_openssl.cc b/core/src/lib/tls_openssl.cc index 7ce7a87b0b2..18c2cd8c0b7 100644 --- a/core/src/lib/tls_openssl.cc +++ b/core/src/lib/tls_openssl.cc @@ -30,30 +30,6 @@ #include "lib/bpoll.h" #include -static inline int cval(char c) -{ - if (c >= 'a') - return c - 'a' + 0x0a; - if (c >= 'A') - return c - 'A' + 0x0a; - return c - '0'; -} - -/* return value: number of bytes in out, <=0 if error */ -int hex2bin(char *str, unsigned char *out, unsigned int max_out_len) -{ - unsigned int i; - for (i = 0; str[i] && str[i + 1] && i < max_out_len * 2; i += 2) { - if (!isxdigit(str[i]) && !isxdigit(str[i + 1])) { - return -1; - } - out[i / 2] = (cval(str[i]) << 4) + cval(str[i + 1]); - } - - return i / 2; -} - - #if defined(HAVE_TLS) && defined(HAVE_OPENSSL) #include