wlan_common/ie/rsn/
pmkid.rs

1// Copyright 2018 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use super::Error;
6use anyhow::ensure;
7use bytes::Bytes;
8
9pub type Pmkid = Bytes;
10
11pub fn new(pmkid: Bytes) -> Result<Pmkid, anyhow::Error> {
12    ensure!(pmkid.len() == 16, Error::InvalidPmkidLength(pmkid.len()));
13    Ok(pmkid)
14}