Bug 208305 - [patch] geli(8): Negative iterations values dumped incorrectly
Summary: [patch] geli(8): Negative iterations values dumped incorrectly
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: FreeBSD bugs mailing list
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-03-26 11:03 UTC by Fabian Keil
Modified: 2017-05-06 00:52 UTC (History)
2 users (show)

See Also:


Attachments
geli(8): Dump negative iterations values properly (1.36 KB, patch)
2016-03-26 11:03 UTC, Fabian Keil
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Keil 2016-03-26 11:03:33 UTC
Created attachment 168648 [details]
geli(8): Dump negative iterations values properly

The attached patch lets "geli dump" display negative iterations values properly.

An iterations value of -1 signals that no passphrase is being used.
Previously it was dumped incorrectly due to being cast to unsigned
first:
    
    [fk@elektrobier ~]$ geli dump /dev/ada3p3
    Metadata on /dev/ada3p3:
         magic: GEOM::ELI
       version: 7
         flags: 0x2
         ealgo: AES-XTS
        keylen: 256
      provsize: 8589934592
    sectorsize: 4096
          keys: 0x01
    iterations: 4294967295
          Salt: [...]
    Master Key: [...]
      MD5 hash: 44e17ea9c25f27dff32179bc4f82f659
    
Obtained from: ElectroBSD
Comment 1 Fabian Keil 2016-03-27 15:27:33 UTC
As it turns out the issue was previously reported by Julian Hsiao
as a side note of bug #196834.
Comment 2 commit-hook freebsd_committer 2017-04-21 07:44:48 UTC
A commit references this bug:

Author: mav
Date: Fri Apr 21 07:43:44 UTC 2017
New revision: 317247
URL: https://svnweb.freebsd.org/changeset/base/317247

Log:
  Dump md_iterations as signed, which it really is.

  PR:		208305
  PR:		196834
  MFC after:	2 weeks

Changes:
  head/sys/geom/eli/g_eli.h
Comment 3 commit-hook freebsd_committer 2017-05-06 00:52:11 UTC
A commit references this bug:

Author: mav
Date: Sat May  6 00:51:26 UTC 2017
New revision: 317859
URL: https://svnweb.freebsd.org/changeset/base/317859

Log:
  MFC r317247: Dump md_iterations as signed, which it really is.

  PR:		208305
  PR:		196834

Changes:
_U  stable/11/
  stable/11/sys/geom/eli/g_eli.h