-
Couldn't load subscription status.
- Fork 881
rkt: check signatures on --stage1-* options #2336
Conversation
1fac843 to
41f6d7e
Compare
rkt/stage1hash.go
Outdated
| ks := getKeystore() | ||
| // if the location of stage1 is in the default directory, we don't check | ||
| // the signature. | ||
| absLocation := filepath.Clean(location) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh? filepath.Clean does not return the absolute path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, what I was thinking :D
41f6d7e to
4e2a54f
Compare
No, when user doesn't pass any flag, stage1 image paths will be taken from configuration. If there's none, it will be taken from build defaults. |
rkt/stage1hash.go
Outdated
| ks := getKeystore() | ||
| // if the location of stage1 is in the default directory, we don't check | ||
| // the signature. | ||
| absLocation := filepath.Abs(location) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filepath.Abs returns an error IIRC.
4e2a54f to
49edc7e
Compare
OK, I guess I meant if the user doesn't pass any flags and there's no configuration :P |
|
Ok, first when no The image reference is used to look for the image in the store only (there is no fetching from remote), so at this point signature checking is not relevant. If there is no such image in the store, we use the location to fetch it and that's where we have to decide if the signature should be checked. In this case we should skip the verification if the location is either the same as the build-time default location ( Now, when
|
|
Implementation-wise, since the are some various conditions when the verification should be skipped or not, it would be better if the |
|
Thanks for the write-up. That still misses the case where we use the image in the same directory as rkt. |
394b06c to
08acd8f
Compare
rkt/stage1hash.go
Outdated
| if err != nil { | ||
| return false, err | ||
| } | ||
| if location == buildDefaultStage1ImageLoc || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use absLocation here.
|
One nit, otherwise LFAD. |
|
I guess I need to update the documentation |
We were not checking signatures when the uses passes `--stage1-*` options.
Simply use `--stage1-name` in most of the examples now that we have the stage1 images in coreos.com.
08acd8f to
bbd2b67
Compare
|
LFAD if green. I hope it won't break too many workflows, but it looks like it is a right thing to do. |
We were not checking signatures when the uses passes
--stage1-*options.
The new behavior is like so:
--stage1-*flag, we always check the signature unless the resulting path is the one configured at build time.Does this make sense? // @krnowak