Skip to content

Commit

Permalink
Store KeyEncryptionKey as s_password
Browse files Browse the repository at this point in the history
Seems we forgot to change the KeyEncryptionKey storing to use the new
s_password encoding.
  • Loading branch information
Marco van Wieringen committed Oct 10, 2014
1 parent 7c41eed commit cb97097
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/plugins/stored/scsicrypto-sd.c
Expand Up @@ -379,18 +379,18 @@ static bRC do_set_scsi_encryption_key(void *value)
*/
if (dcr->jcr && dcr->jcr->director) {
director = dcr->jcr->director;
if (director->keyencrkey) {
if (director->keyencrkey.value) {
char WrappedVolEncrKey[MAX_NAME_LENGTH];

memcpy(WrappedVolEncrKey, VolEncrKey, MAX_NAME_LENGTH);
memset(VolEncrKey, 0, MAX_NAME_LENGTH);

if (aes_unwrap((unsigned char *)director->keyencrkey,
if (aes_unwrap((unsigned char *)director->keyencrkey.value,
DEFAULT_PASSPHRASE_LENGTH / 8,
(unsigned char *)WrappedVolEncrKey,
(unsigned char *)VolEncrKey) != 0) {
Dmsg1(dbglvl,
"scsicrypto-sd: Failed to unwrap encryption key using %s\n", director->keyencrkey);
"scsicrypto-sd: Failed to unwrap encryption key using %s\n", director->keyencrkey.value);
Emsg0(M_ERROR, 0,
_("scsicrypto-sd: Failed to unwrap encryption key, probably wrong KeyEncryptionKey in config\n"));
return bRC_Error;
Expand Down
4 changes: 2 additions & 2 deletions src/stored/stored_conf.c
Expand Up @@ -637,8 +637,8 @@ void free_resource(RES *sres, int type)
if (res->res_dir.tls_allowed_cns) {
delete res->res_dir.tls_allowed_cns;
}
if (res->res_dir.keyencrkey) {
free(res->res_dir.keyencrkey);
if (res->res_dir.keyencrkey.value) {
free(res->res_dir.keyencrkey.value);
}
break;
case R_NDMP:
Expand Down
2 changes: 1 addition & 1 deletion src/stored/stored_conf.h
Expand Up @@ -63,7 +63,7 @@ class DIRRES {
char *tls_dhfile; /* TLS Diffie-Hellman Parameters */
alist *tls_allowed_cns; /* TLS Allowed Clients */
uint64_t max_bandwidth_per_job; /* Bandwidth limitation (per director) */
char *keyencrkey; /* Key Encryption Key */
s_password keyencrkey; /* Key Encryption Key */

TLS_CONTEXT *tls_ctx; /* Shared TLS Context */
};
Expand Down

0 comments on commit cb97097

Please sign in to comment.