/freebsd/sys/geom/mirror/ |
H A D | g_mirror.h | 223 const struct g_mirror_metadata *md, u_int type); 231 struct g_mirror_metadata *md); 232 int g_mirror_read_metadata(struct g_consumer *cp, struct g_mirror_metadata *md); 234 struct g_mirror_disk *disk, struct g_mirror_metadata *md); 263 mirror_metadata_encode(struct g_mirror_metadata *md, u_char *data) in mirror_metadata_encode() argument 267 bcopy(md->md_magic, data, 16); in mirror_metadata_encode() 268 le32enc(data + 16, md->md_version); in mirror_metadata_encode() 269 bcopy(md->md_name, data + 20, 16); in mirror_metadata_encode() 270 le32enc(data + 36, md->md_mid); in mirror_metadata_encode() 271 le32enc(data + 40, md->md_did); in mirror_metadata_encode() [all …]
|
/freebsd/sys/geom/raid3/ |
H A D | g_raid3.h | 243 struct g_raid3_metadata *md); 244 int g_raid3_read_metadata(struct g_consumer *cp, struct g_raid3_metadata *md); 246 struct g_raid3_metadata *md); 272 raid3_metadata_encode(struct g_raid3_metadata *md, u_char *data) in raid3_metadata_encode() argument 276 bcopy(md->md_magic, data, 16); in raid3_metadata_encode() 277 le32enc(data + 16, md->md_version); in raid3_metadata_encode() 278 bcopy(md->md_name, data + 20, 16); in raid3_metadata_encode() 279 le32enc(data + 36, md->md_id); in raid3_metadata_encode() 280 le16enc(data + 40, md->md_no); in raid3_metadata_encode() 281 le16enc(data + 42, md->md_all); in raid3_metadata_encode() [all …]
|
/freebsd/sbin/mdconfig/tests/ |
H A D | mdconfig_test.sh | 28 local md=$1 36 …-o match:"/dev/$md *$sectorsize *$mediasize_in_bytes *$mediasize_in_sectors *$stripesize *$stripeo… 37 -x "diskinfo /dev/$md | expand" 54 local md 59 md=$(cat mdconfig.out) 60 atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" 61 check_diskinfo "$md" "1073741824" "2097152" 63 atf_check -s exit:0 -o match:"^$md vnode ${size_in_mb}M$" \ 64 -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" 78 local md [all …]
|
/freebsd/sys/geom/eli/ |
H A D | g_eli.h | 260 eli_metadata_encode_v0(struct g_eli_metadata *md, u_char **datap) in eli_metadata_encode_v0() argument 265 le32enc(p, md->md_flags); p += sizeof(md->md_flags); in eli_metadata_encode_v0() 266 le16enc(p, md->md_ealgo); p += sizeof(md->md_ealgo); in eli_metadata_encode_v0() 267 le16enc(p, md->md_keylen); p += sizeof(md->md_keylen); in eli_metadata_encode_v0() 268 le64enc(p, md->md_provsize); p += sizeof(md->md_provsize); in eli_metadata_encode_v0() 269 le32enc(p, md->md_sectorsize); p += sizeof(md->md_sectorsize); in eli_metadata_encode_v0() 270 *p = md->md_keys; p += sizeof(md->md_keys); in eli_metadata_encode_v0() 271 le32enc(p, md->md_iterations); p += sizeof(md->md_iterations); in eli_metadata_encode_v0() 272 bcopy(md->md_salt, p, sizeof(md->md_salt)); p += sizeof(md->md_salt); in eli_metadata_encode_v0() 273 bcopy(md->md_mkeys, p, sizeof(md->md_mkeys)); p += sizeof(md->md_mkeys); in eli_metadata_encode_v0() [all …]
|
/freebsd/sys/dev/proto/ |
H A D | proto_busdma.c | 57 struct proto_md *md; member 145 struct proto_md *md) in proto_busdma_md_destroy_internal() argument 148 LIST_REMOVE(md, mds); in proto_busdma_md_destroy_internal() 149 LIST_REMOVE(md, peers); in proto_busdma_md_destroy_internal() 150 if (md->physaddr) in proto_busdma_md_destroy_internal() 151 bus_dmamap_unload(md->bd_tag, md->bd_map); in proto_busdma_md_destroy_internal() 152 if (md->virtaddr != NULL) in proto_busdma_md_destroy_internal() 153 bus_dmamem_free(md->bd_tag, md->virtaddr, md->bd_map); in proto_busdma_md_destroy_internal() 155 bus_dmamap_destroy(md->bd_tag, md->bd_map); in proto_busdma_md_destroy_internal() 156 bus_dma_tag_destroy(md->bd_tag); in proto_busdma_md_destroy_internal() [all …]
|
/freebsd/tests/sys/geom/class/eli/ |
H A D | online_resize_test.sh | 45 attach_md md -t malloc -s40${prefix} 48 atf_check -s exit:0 -o ignore gpart create -s GPT ${md} 49 atf_check -s exit:0 -o ignore gpart add -t freebsd-ufs -s 10${prefix} ${md} 53 atf_check geli init ${aalgo} -s ${sector} -Bnone -PKtmp.key ${md}p1 55 atf_check -s exit:0 -o match:"flags: ${eflags}$" geli dump ${md}p1 57 atf_check geli configure -R ${md}p1 58 atf_check -s exit:0 -o match:"flags: ${dflags}$" geli dump ${md}p1 59 atf_check geli configure -r ${md}p1 60 atf_check -s exit:0 -o match:"flags: ${eflags}$" geli dump ${md}p1 62 atf_check geli init -R ${aalgo} -s ${sector} -Bnone -PKtmp.key ${md}p1 [all …]
|
H A D | init_test.sh | 14 -s $secsize ${md} 15 atf_check geli attach -p -k keyfile ${md} 17 atf_check dd if=rnd of=/dev/${md}.eli bs=${secsize} count=${sectors} \ 22 md_ddev=`dd if=/dev/${md}.eli bs=${secsize} count=${sectors} status=none | md5` 24 md_edev=`dd if=/dev/${md} bs=${secsize} count=${sectors} status=none | md5` 71 attach_md md -t malloc -s $sectors 74 rm -f /var/backups/${md}.eli 75 atf_check -s exit:0 -o ignore geli init -B none -P -K keyfile ${md} 76 if [ -f /var/backups/${md}.eli ]; then 81 rm -f /var/backups/${md}.eli [all …]
|
H A D | resize_test.sh | 18 attach_md md -t malloc -s40m 21 atf_check -s exit:0 -o ignore gpart create -s BSD ${md} 22 atf_check -s exit:0 -o ignore gpart add -t freebsd-ufs -s 10m ${md} 25 atf_check geli init -Bnone -PKtmp.key ${md}a 26 atf_check geli attach -pk tmp.key ${md}a 28 atf_check -s exit:0 -o ignore newfs -U ${md}a.eli 29 atf_check -s exit:7 -o ignore fsck_ffs -Ffy ${md}a.eli 34 atf_check geli backup ${md}a tmp.meta 35 atf_check geli detach ${md}a.eli 36 atf_check -s exit:0 -o match:resized gpart resize -i1 -s 20m ${md} [all …]
|
H A D | setkey_test.sh | 16 attach_md md -t malloc -s `expr $sectors + 1` 27 atf_check geli init -B none -P -K keyfile1 ${md} 28 atf_check geli attach -p -k keyfile1 ${md} 31 dd if=rnd of=/dev/${md}.eli bs=512 count=${sectors} status=none 32 hash2=`dd if=/dev/${md}.eli bs=512 count=${sectors} 2>/dev/null | md5` 36 atf_check -s exit:0 -o ignore geli setkey -P -K keyfile2 ${md} 37 atf_check geli detach ${md} 41 geli attach -p -k keyfile1 ${md} 44 atf_check geli attach -p -k keyfile2 ${md} 45 hash3=`dd if=/dev/${md}.eli bs=512 count=${sectors} 2>/dev/null | md5` [all …]
|
/freebsd/sys/geom/virstor/ |
H A D | g_virstor_md.c | 40 virstor_metadata_encode(struct g_virstor_metadata *md, unsigned char *data) in virstor_metadata_encode() argument 46 bs_write_buf(&bs, md->md_magic, sizeof(md->md_magic)); in virstor_metadata_encode() 47 bs_write_u32(&bs, md->md_version); in virstor_metadata_encode() 48 bs_write_buf(&bs, md->md_name, sizeof(md->md_name)); in virstor_metadata_encode() 49 bs_write_u64(&bs, md->md_virsize); in virstor_metadata_encode() 50 bs_write_u32(&bs, md->md_chunk_size); in virstor_metadata_encode() 51 bs_write_u32(&bs, md->md_id); in virstor_metadata_encode() 52 bs_write_u16(&bs, md->md_count); in virstor_metadata_encode() 54 bs_write_buf(&bs, md->provider, sizeof(md->provider)); in virstor_metadata_encode() 55 bs_write_u16(&bs, md->no); in virstor_metadata_encode() [all …]
|
/freebsd/contrib/wpa/src/crypto/ |
H A D | sha256-internal.c | 81 static int sha256_compress(struct sha256_state *md, unsigned char *buf) in sha256_compress() argument 89 S[i] = md->state[i]; in sha256_compress() 117 md->state[i] = md->state[i] + S[i]; in sha256_compress() 124 void sha256_init(struct sha256_state *md) in sha256_init() argument 126 md->curlen = 0; in sha256_init() 127 md->length = 0; in sha256_init() 128 md->state[0] = 0x6A09E667UL; in sha256_init() 129 md->state[1] = 0xBB67AE85UL; in sha256_init() 130 md->state[2] = 0x3C6EF372UL; in sha256_init() 131 md->state[3] = 0xA54FF53AUL; in sha256_init() [all …]
|
H A D | sha512-internal.c | 107 static int sha512_compress(struct sha512_state *md, unsigned char *buf) in sha512_compress() argument 119 S[i] = md->state[i]; in sha512_compress() 148 md->state[i] = md->state[i] + S[i]; in sha512_compress() 161 void sha512_init(struct sha512_state *md) in sha512_init() argument 163 md->curlen = 0; in sha512_init() 164 md->length = 0; in sha512_init() 165 md->state[0] = CONST64(0x6a09e667f3bcc908); in sha512_init() 166 md->state[1] = CONST64(0xbb67ae8584caa73b); in sha512_init() 167 md->state[2] = CONST64(0x3c6ef372fe94f82b); in sha512_init() 168 md->state[3] = CONST64(0xa54ff53a5f1d36f1); in sha512_init() [all …]
|
/freebsd/sys/geom/multipath/ |
H A D | g_multipath.h | 76 multipath_metadata_encode(const struct g_multipath_metadata *md, u_char *data) in multipath_metadata_encode() argument 78 bcopy(md->md_magic, data, sizeof(md->md_magic)); in multipath_metadata_encode() 79 data += sizeof(md->md_magic); in multipath_metadata_encode() 80 bcopy(md->md_uuid, data, sizeof(md->md_uuid)); in multipath_metadata_encode() 81 data += sizeof(md->md_uuid); in multipath_metadata_encode() 82 bcopy(md->md_name, data, sizeof(md->md_name)); in multipath_metadata_encode() 83 data += sizeof(md->md_name); in multipath_metadata_encode() 84 le32enc(data, md->md_version); in multipath_metadata_encode() 85 data += sizeof(md->md_version); in multipath_metadata_encode() 86 le32enc(data, md->md_sectorsize); in multipath_metadata_encode() [all …]
|
/freebsd/lib/geom/virstor/ |
H A D | geom_virstor.c | 151 struct g_virstor_metadata md; in virstor_label() local 179 bzero(&md, sizeof(md)); in virstor_label() 180 strlcpy(md.md_magic, G_VIRSTOR_MAGIC, sizeof(md.md_magic)); in virstor_label() 181 md.md_version = G_VIRSTOR_VERSION; in virstor_label() 187 strlcpy(md.md_name, name, sizeof(md.md_name)); in virstor_label() 189 md.md_virsize = (off_t)gctl_get_intmax(req, "vir_size"); in virstor_label() 190 md.md_chunk_size = gctl_get_intmax(req, "chunk_size"); in virstor_label() 191 md.md_count = nargs - 1; in virstor_label() 193 if (md.md_virsize == 0 || md.md_chunk_size == 0) { in virstor_label() 221 if (md.md_chunk_size % secsize != 0) { in virstor_label() [all …]
|
/freebsd/crypto/openssl/crypto/sha/ |
H A D | sha1_one.c | 23 unsigned char *ossl_sha1(const unsigned char *d, size_t n, unsigned char *md) in ossl_sha1() argument 28 if (md == NULL) in ossl_sha1() 29 md = m; in ossl_sha1() 33 SHA1_Final(md, &c); in ossl_sha1() 35 return md; in ossl_sha1() 38 unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md) in SHA1() argument 42 if (md == NULL) in SHA1() 43 md = m; in SHA1() 44 return EVP_Q_digest(NULL, "SHA1", NULL, d, n, md, NULL) ? md : NULL; in SHA1() 47 unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md) in SHA224() argument [all …]
|
/freebsd/sys/dev/wtap/ |
H A D | if_medium.c | 35 init_medium(struct wtap_medium *md) in init_medium() argument 39 STAILQ_INIT(&md->md_pktbuf); in init_medium() 40 mtx_init(&md->md_mtx, "wtap_medium mtx", NULL, MTX_DEF | MTX_RECURSE); in init_medium() 48 md->tx_handler = eh; in init_medium() 50 md->open = 0; in init_medium() 54 deinit_medium(struct wtap_medium *md) in deinit_medium() argument 58 taskqueue_free(md->tx_handler->tq); in deinit_medium() 59 free(md->tx_handler, M_WTAP); in deinit_medium() 63 medium_transmit(struct wtap_medium *md, int id, struct mbuf*m) in medium_transmit() argument 66 mtx_lock(&md->md_mtx); in medium_transmit() [all …]
|
/freebsd/tools/bus_space/ |
H A D | busdma.c | 70 } md; member 252 bd_md_add_seg(struct obj *md, int type, u_long addr, u_long size) in bd_md_add_seg() argument 260 seg->parent = md; in bd_md_add_seg() 264 md->u.md.seg[type] = seg; in bd_md_add_seg() 265 md->u.md.nsegs[type] = 1; in bd_md_add_seg() 270 bd_md_del_segs(struct obj *md, int type, int unmap) in bd_md_del_segs() argument 274 for (seg = md->u.md.seg[type]; seg != NULL; seg = seg0) { in bd_md_del_segs() 287 struct obj *md, *tag; in bd_md_create() local 293 md = obj_alloc(OBJ_TYPE_MD); in bd_md_create() 294 if (md == NULL) in bd_md_create() [all …]
|
/freebsd/usr.sbin/bsdinstall/partedit/ |
H A D | partedit.c | 77 struct partition_metadata *md; in main() local 161 while ((md = TAILQ_FIRST(&part_metadata)) != NULL) { in main() 162 if (md->fstab != NULL) { in main() 163 free(md->fstab->fs_spec); in main() 164 free(md->fstab->fs_file); in main() 165 free(md->fstab->fs_vfstype); in main() 166 free(md->fstab->fs_mntops); in main() 167 free(md->fstab->fs_type); in main() 168 free(md->fstab); in main() 170 if (md->newfs != NULL) in main() [all …]
|
/freebsd/crypto/openssl/engines/ |
H A D | e_ossltest.c | 66 static int digest_md5_final(EVP_MD_CTX *ctx, unsigned char *md); 72 EVP_MD *md; in digest_md5() local 74 if ((md = EVP_MD_meth_new(NID_md5, NID_md5WithRSAEncryption)) == NULL in digest_md5() 75 || !EVP_MD_meth_set_result_size(md, MD5_DIGEST_LENGTH) in digest_md5() 76 || !EVP_MD_meth_set_input_blocksize(md, MD5_CBLOCK) in digest_md5() 77 || !EVP_MD_meth_set_app_datasize(md, in digest_md5() 79 || !EVP_MD_meth_set_flags(md, 0) in digest_md5() 80 || !EVP_MD_meth_set_init(md, digest_md5_init) in digest_md5() 81 || !EVP_MD_meth_set_update(md, digest_md5_update) in digest_md5() 82 || !EVP_MD_meth_set_final(md, digest_md5_final)) { in digest_md5() [all …]
|
/freebsd/sys/geom/stripe/ |
H A D | g_stripe.h | 84 stripe_metadata_encode(const struct g_stripe_metadata *md, u_char *data) in stripe_metadata_encode() 87 bcopy(md->md_magic, data, sizeof(md->md_magic)); in stripe_metadata_encode() 88 le32enc(data + 16, md->md_version); in stripe_metadata_encode() 89 bcopy(md->md_name, data + 20, sizeof(md->md_name)); in stripe_metadata_encode() 90 le32enc(data + 36, md->md_id); in stripe_metadata_encode() 91 le16enc(data + 40, md->md_no); in stripe_metadata_encode() 92 le16enc(data + 42, md->md_all); in stripe_metadata_encode() 93 le32enc(data + 44, md in stripe_metadata_encode() 81 stripe_metadata_encode(const struct g_stripe_metadata * md,u_char * data) stripe_metadata_encode() argument 95 stripe_metadata_decode(const u_char * data,struct g_stripe_metadata * md) stripe_metadata_decode() argument [all...] |
/freebsd/crypto/openssl/test/recipes/30-test_evp_data/ |
H A D | evppkey_kdf_hkdf.txt | 17 Ctrl.md = md:SHA256 25 Ctrl.md = md:SHA256 32 Ctrl.md = md:SHA256 38 Ctrl.md = md:SHA256 46 Ctrl.md = md:SHA256 53 Ctrl.md = md:SHA256 59 Ctrl.md = md:SHA256 67 Ctrl.md = md:SHA256 75 Ctrl.md = md:SHA256 81 Ctrl.md = md:SHA1 [all …]
|
/freebsd/sys/geom/shsec/ |
H A D | g_shsec.h | 74 shsec_metadata_encode(const struct g_shsec_metadata *md, u_char *data) in shsec_metadata_encode() argument 77 bcopy(md->md_magic, data, sizeof(md->md_magic)); in shsec_metadata_encode() 78 le32enc(data + 16, md->md_version); in shsec_metadata_encode() 79 bcopy(md->md_name, data + 20, sizeof(md->md_name)); in shsec_metadata_encode() 80 le32enc(data + 36, md->md_id); in shsec_metadata_encode() 81 le16enc(data + 40, md->md_no); in shsec_metadata_encode() 82 le16enc(data + 42, md->md_all); in shsec_metadata_encode() 83 bcopy(md->md_provider, data + 44, sizeof(md->md_provider)); in shsec_metadata_encode() 84 le64enc(data + 60, md->md_provsize); in shsec_metadata_encode() 87 shsec_metadata_decode(const u_char *data, struct g_shsec_metadata *md) in shsec_metadata_decode() argument [all …]
|
/freebsd/lib/geom/eli/ |
H A D | geom_eli.c | 486 eli_genkey_passphrase(struct gctl_req *req, struct g_eli_metadata *md, bool new, in eli_genkey_passphrase() argument 513 if (!new && md->md_iterations == -1) { in eli_genkey_passphrase() 540 if (md->md_iterations == -1) { in eli_genkey_passphrase() 544 md->md_iterations = pkcs5v2_calculate(2000000); in eli_genkey_passphrase() 545 assert(md->md_iterations > 0); in eli_genkey_passphrase() 548 md->md_iterations); in eli_genkey_passphrase() 554 if (md->md_iterations == 0) { in eli_genkey_passphrase() 555 g_eli_crypto_hmac_update(ctxp, md->md_salt, in eli_genkey_passphrase() 556 sizeof(md->md_salt)); in eli_genkey_passphrase() 561 pkcs5v2_genkey(dkey, sizeof(dkey), md->md_salt, in eli_genkey_passphrase() [all …]
|
/freebsd/tests/sys/geom/class/part/ |
H A D | misc.sh | 39 md=$(alloc_md) 40 atf_check -o empty -e ignore diskinfo -p ${md} 41 atf_check -s exit:0 -o ignore gpart create -s bsd ${md} 42 atf_check -s exit:0 -o ignore gpart add -t freebsd-ufs ${md} 43 atf_check -o empty -e ignore diskinfo -p ${md}a 61 md=$(alloc_md) 63 atf_check gnop create -z $physpath /dev/${md} 64 atf_check -s exit:0 -o ignore gpart create -s bsd ${md}.nop 65 atf_check -s exit:0 -o ignore gpart add -t freebsd-ufs ${md}.nop 66 gpart_physpath=$(diskinfo -p ${md}.nopa) [all …]
|
/freebsd/sys/geom/concat/ |
H A D | g_concat.h | 92 concat_metadata_encode(const struct g_concat_metadata *md, u_char *data) in concat_metadata_encode() argument 95 bcopy(md->md_magic, data, sizeof(md->md_magic)); in concat_metadata_encode() 96 le32enc(data + 16, md->md_version); in concat_metadata_encode() 97 bcopy(md->md_name, data + 20, sizeof(md->md_name)); in concat_metadata_encode() 98 le32enc(data + 36, md->md_id); in concat_metadata_encode() 99 le16enc(data + 40, md->md_no); in concat_metadata_encode() 100 le16enc(data + 42, md->md_all); in concat_metadata_encode() 101 bcopy(md->md_provider, data + 44, sizeof(md->md_provider)); in concat_metadata_encode() 102 le64enc(data + 60, md->md_provsize); in concat_metadata_encode() 105 concat_metadata_decode(const u_char *data, struct g_concat_metadata *md) in concat_metadata_decode() argument [all …]
|