Skip to content

Encrypted key with empty password does not work #44

@RanjeetMishra

Description

@RanjeetMishra

Because of password len check here, encrypted key with empty password does not work.

  1. Should encrypted key with empty password be supported?
  2. If answer to point 1 is yes, would below check suffice?
func isEncryptedKey(der []byte) bool {
	type EncryptedPrivateKeyInfo struct {
		Algorithm     asn1.RawValue // Encryption algorithm and parameters
		EncryptedData []byte        // The encrypted private key bytes
	}
	var encryptedKey EncryptedPrivateKeyInfo

	_, err := asn1.Unmarshal(der, &encryptedKey)
	return err == nil
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions