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 6c927d7 commit 7c41eed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/dird/dird_conf.c
Expand Up @@ -1728,8 +1728,8 @@ void free_resource(RES *sres, int type)
if (res->res_dir.verid) {
free(res->res_dir.verid);
}
if (res->res_dir.keyencrkey) {
free(res->res_dir.keyencrkey);
if (res->res_dir.keyencrkey.value) {
free(res->res_dir.keyencrkey.value);
}
if (res->res_dir.audit_events) {
delete res->res_dir.audit_events;
Expand Down
2 changes: 1 addition & 1 deletion src/dird/dird_conf.h
Expand Up @@ -138,7 +138,7 @@ class DIRRES: public BRSRES {
uint32_t jcr_watchdog_time; /* Absolute time after which a Job gets terminated regardless of its progress */
uint32_t stats_collect_interval; /* Statistics collect interval in seconds */
char *verid; /* Custom Id to print in version command */
char *keyencrkey; /* Key Encryption Key */
s_password keyencrkey; /* Key Encryption Key */
};

/*
Expand Down
4 changes: 2 additions & 2 deletions src/dird/ua_label.c
Expand Up @@ -688,13 +688,13 @@ static bool generate_new_encryption_key(UAContext *ua, MEDIA_DBR *mr)
/*
* See if we need to wrap the passphrase.
*/
if (me->keyencrkey) {
if (me->keyencrkey.value) {
char *wrapped_passphrase;

length = DEFAULT_PASSPHRASE_LENGTH + 8;
wrapped_passphrase = (char *)malloc(length);
memset(wrapped_passphrase, 0, length);
aes_wrap((unsigned char *)me->keyencrkey,
aes_wrap((unsigned char *)me->keyencrkey.value,
DEFAULT_PASSPHRASE_LENGTH / 8,
(unsigned char *)passphrase,
(unsigned char *)wrapped_passphrase);
Expand Down

0 comments on commit 7c41eed

Please sign in to comment.